We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c48760 commit 7beadf4Copy full SHA for 7beadf4
CMakeLists.txt
@@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.11)
3
project(tl-optional VERSION 1.0.0 LANGUAGES CXX)
4
5
option(OPTIONAL_ENABLE_TESTS "Enable tests." ON)
6
+option(OPTIONAL_WERROR "Turn compiler warnings into errors" OFF)
7
8
include(FetchContent)
9
FetchContent_Declare(
@@ -50,3 +51,10 @@ if(OPTIONAL_ENABLE_TESTS)
50
51
set_property(TARGET tests PROPERTY CXX_STANDARD ${CXXSTD})
52
endif()
53
54
+if(OPTIONAL_WERROR)
55
+ if(MSVC)
56
+ target_compile_options(optional INTERFACE /W3 /WX)
57
+ else()
58
+ target_compile_options(optional INTERFACE -Wall -Wextra -pedantic -Werror)
59
+ endif()
60
+endif()
0 commit comments