From 923dcb1a4934e8cf43de965c825fd6ed8abb6d2e Mon Sep 17 00:00:00 2001 From: slipher Date: Sat, 15 Jun 2024 21:14:39 -0500 Subject: [PATCH] Make cmake build usable with Visual Studio --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d7f2c954..0a3564e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,11 +32,15 @@ option(BUILD_SHARED_LIBCRN "Build shared libcrn" OFF) option(BUILD_STATIC_LIBCRN "Build static libcrn" OFF) option(BUILD_CRUNCH "Build crunch" ON) option(BUILD_EXAMPLES "Build examples" OFF) -option(OPTIMIZE_RELEASE "Optimize release build" ON) +if (NOT MSVC) + option(OPTIMIZE_RELEASE "Optimize release build" ON) +endif() set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unused-value -Wno-unused") +if (NOT MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unused-value -Wno-unused") +endif() if(OPTIMIZE_RELEASE) # CMake already sets -O3 flag on release build