summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorKeuin <[email protected]>2022-12-24 17:08:15 +0800
committerKeuin <[email protected]>2022-12-24 17:26:01 +0800
commit0987464cf99120b6728949496ee41bd14a35b225 (patch)
tree749e84bcd17ec002bc486aa308c8636df2e21de2 /CMakeLists.txt
parentda03ccd81467af87452b45763da87a4e3ce603a1 (diff)
Make it compile with MSVC.HEADmaster
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt19
1 files changed, 14 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 22b29e8..332f10e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,8 +5,15 @@ set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
-set(common_compiler_args "-Wall -Werror -Wno-unused -std=c++11")
-set(CMAKE_CXX_FLAGS_DEBUG "${common_compiler_args} -g -ggdb -fsanitize=address -DDEBUG")
+set(common_compiler_args "-Wall")
+if (!MSVC)
+ set(common_compiler_args "${common_compiler_args} -Werror")
+endif ()
+set(common_compiler_args, "${common_compiler_args} -Wno-unused -std=c++11")
+
+if (!MSVC)
+ set(CMAKE_CXX_FLAGS_DEBUG "${common_compiler_args} -g -ggdb -fsanitize=address -DDEBUG")
+endif ()
set(CMAKE_CXX_FLAGS_RELEASE "${common_compiler_args} -O2")
set(CMAKE_VERBOSE_MAKEFILE on)
@@ -14,10 +21,12 @@ set(CMAKE_VERBOSE_MAKEFILE on)
# Avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24:
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
cmake_policy(SET CMP0135 NEW)
-endif()
+endif ()
-link_libraries(pthread)
-link_libraries(atomic)
+if (!MSVC)
+ link_libraries(pthread)
+ link_libraries(atomic)
+endif ()
# main executable