diff --git a/cmake/BuildType.cmake b/cmake/BuildType.cmake index 03ebc34e0..56ba5f09b 100644 --- a/cmake/BuildType.cmake +++ b/cmake/BuildType.cmake @@ -10,8 +10,8 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) message(STATUS "Setting build type to '${default_build_type}' as none was specified.") set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE) -endif() -# Set the possible values of build type for cmake-gui -set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" + # Set the possible values of build type for cmake-gui + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") +endif() diff --git a/cmake/SfizzConfig.cmake b/cmake/SfizzConfig.cmake index 9f8bb462c..8d0e2fe91 100644 --- a/cmake/SfizzConfig.cmake +++ b/cmake/SfizzConfig.cmake @@ -41,7 +41,7 @@ endif() # Process sources as UTF-8 if(MSVC) - add_compile_options("/utf-8") + add_compile_options($<$:/utf-8>) endif() # Define the math constants everywhere @@ -104,7 +104,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") endif() endif() elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - add_compile_options(/Zc:__cplusplus) + add_compile_options($<$:/Zc:__cplusplus>) set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") endif() diff --git a/external/st_audiofile/src/st_audiofile.c b/external/st_audiofile/src/st_audiofile.c index 1abc51dae..d29f6a2b7 100644 --- a/external/st_audiofile/src/st_audiofile.c +++ b/external/st_audiofile/src/st_audiofile.c @@ -9,6 +9,9 @@ #include "st_audiofile_libs.h" #include +#ifdef _WIN32 +#include +#endif #define WAVPACK_MEMORY_ASSUMED_VERSION 5 struct st_audio_file { @@ -179,10 +182,17 @@ static st_audio_file* st_generic_open_file(const void* filename, int widepath) // Try WV { - af->wv = #if defined(_WIN32) - WavpackOpenFileInput((const char*)filename, NULL, OPEN_FILE_UTF8, 0); + // WavPack expects an UTF8 input and has no widechar api, so we convert the filename back... + unsigned wsize = wcslen(filename); + unsigned size = WideCharToMultiByte(CP_UTF8, 0, filename, wsize, NULL, 0, 0, NULL, NULL); + char *buffer = (char*)malloc((size+1) * sizeof(char)); + WideCharToMultiByte(CP_UTF8, 0, filename, wsize, buffer, size, NULL, NULL); + buffer[size] = '\0'; + af->wv = + WavpackOpenFileInput(buffer, NULL, OPEN_FILE_UTF8, 0); #else + af->wv = WavpackOpenFileInput((const char*)filename, NULL, 0, 0); #endif if (af->wv) { diff --git a/src/sfizz/FilePool.cpp b/src/sfizz/FilePool.cpp index e15be0f40..76fd69b7b 100644 --- a/src/sfizz/FilePool.cpp +++ b/src/sfizz/FilePool.cpp @@ -477,7 +477,7 @@ void sfz::FilePool::loadingJob(const QueuedFileData& data) noexcept AudioReaderPtr reader = createAudioReader(file, id->isReverse(), &readError); if (readError) { - DBG("[sfizz] libsndfile errored for " << *id << " with message " << readError.message()); + DBG("[sfizz] reading the file errored for " << *id << " with code " << readError << ": " << readError.message()); return; }