From d470f7004ec29956a987a50dd6a937e0f1577c94 Mon Sep 17 00:00:00 2001 From: Paul Fd Date: Mon, 7 Aug 2023 11:44:28 +0200 Subject: [PATCH] Fix build on Windows - C/CXX should not be passed to MASM - Fix CMAKE_BUILD_TYPE --- cmake/BuildType.cmake | 6 +++--- cmake/SfizzConfig.cmake | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmake/BuildType.cmake b/cmake/BuildType.cmake index 03ebc34e..56ba5f09 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 9f8bb462..8d0e2fe9 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()