diff --git a/rhubarb/CMakeLists.txt b/rhubarb/CMakeLists.txt index 84d2b23..be20efc 100644 --- a/rhubarb/CMakeLists.txt +++ b/rhubarb/CMakeLists.txt @@ -28,10 +28,17 @@ endif() # Support legacy OS X versions set(CMAKE_OSX_DEPLOYMENT_TARGET "10.10" CACHE STRING "Minimum OS X deployment version") -# Enable C++17 -set(CMAKE_CXX_STANDARD 17) +# Enable C++23 +set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED ON) +# Disable char8_t support (see https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1423r3.html) +if(compilerIsGccOrClang) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-char8_t") +elseif(compilerIsMsvc) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:char8_t-") +endif() + # Enable POSIX threads if(compilerIsGccOrClang) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") diff --git a/rhubarb/src/audio/audio-file-reading.cpp b/rhubarb/src/audio/audio-file-reading.cpp index 8976030..7adc1fc 100644 --- a/rhubarb/src/audio/audio-file-reading.cpp +++ b/rhubarb/src/audio/audio-file-reading.cpp @@ -7,7 +7,6 @@ #include "ogg-vorbis-file-reader.h" #include "wave-file-reader.h" -using fmt::format; using std::runtime_error; using std::string; using std::filesystem::path; @@ -21,13 +20,13 @@ std::unique_ptr createAudioFileClip(path filePath) { if (extension == ".ogg") { return std::make_unique(filePath); } - throw runtime_error(format( + throw runtime_error(fmt::format( "Unsupported file extension '{}'. Supported extensions are '.wav' and '.ogg'.", extension )); } catch (...) { std::throw_with_nested( - runtime_error(format("Could not open sound file {}.", filePath.u8string())) + runtime_error(fmt::format("Could not open sound file {}.", filePath.u8string())) ); } }