summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
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