From eb6d970970b2648f35ae3aa990af28214df85897 Mon Sep 17 00:00:00 2001 From: Be Date: Wed, 18 Aug 2021 12:24:18 -0500 Subject: [PATCH] CMake: set optimization options for MSVC as well as GCC & Clang --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c5c92e..d622719 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,7 +47,12 @@ if(WIN32 AND BUILD_SHARED_LIBS) endif() endif() -target_compile_options(SoundTouch PRIVATE -Ofast) +if(MSVC) + target_compile_definitions(SoundTouch PRIVATE /O2 /fp:fast) +else() + target_compile_options(SoundTouch PRIVATE -Ofast) +endif() + target_compile_definitions(SoundTouch PRIVATE CMAKE) option(INTEGER_SAMPLES "Use integers instead of floats for samples" OFF)