aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2019-08-11 15:47:10 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2019-08-11 15:48:08 +0900
commit35d9c4dd6743d706ed9382c021923ef790e7c446 (patch)
tree4cd00c50c0fa1cf72dfcb023977da2c95798d6c2 /CMakeLists.txt
parentb41acc4c2ee3bf483e89157230655f3695177b60 (diff)
downloadlibquotient-35d9c4dd6743d706ed9382c021923ef790e7c446.tar.gz
libquotient-35d9c4dd6743d706ed9382c021923ef790e7c446.zip
Configure MSVC warnings in CMakeLists.txt; build in AppVeyor with Qt 5.13
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt16
1 files changed, 10 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d0ce98a6..d90b2d88 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -36,12 +36,16 @@ endif()
set(CMAKE_CXX_STANDARD 17)
-foreach (FLAG all "" pedantic extra error=return-type no-unused-parameter no-gnu-zero-variadic-macro-arguments)
- CHECK_CXX_COMPILER_FLAG("-W${FLAG}" WARN_${FLAG}_SUPPORTED)
- if ( WARN_${FLAG}_SUPPORTED AND NOT CMAKE_CXX_FLAGS MATCHES "(^| )-W?${FLAG}($| )")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W${FLAG}")
- endif ()
-endforeach ()
+if (MSVC)
+ add_compile_options(/EHsc /W4)
+else()
+ foreach (FLAG all "" pedantic extra error=return-type no-unused-parameter no-gnu-zero-variadic-macro-arguments)
+ CHECK_CXX_COMPILER_FLAG("-W${FLAG}" WARN_${FLAG}_SUPPORTED)
+ if ( WARN_${FLAG}_SUPPORTED AND NOT CMAKE_CXX_FLAGS MATCHES "(^| )-W?${FLAG}($| )")
+ add_compile_options(-W${FLAG})
+ endif ()
+ endforeach ()
+endif()
find_package(Qt5 5.9 REQUIRED Network Gui Multimedia)
get_filename_component(Qt5_Prefix "${Qt5_DIR}/../../../.." ABSOLUTE)