Skip to content

Commit 7385fa1

Browse files
authored
Merge pull request #283 from offa/option_werror
Add Werror build option
2 parents 910f5ee + c8586eb commit 7385fa1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ option(INFLUXCXX_WITH_BOOST "Build with Boost support enabled" ON)
1818
option(INFLUXCXX_TESTING "Enable testing for this component" ON)
1919
option(INFLUXCXX_SYSTEMTEST "Enable system tests" ON)
2020
option(INFLUXCXX_COVERAGE "Enable Coverage" OFF)
21+
option(INFLUXCXX_WERROR "Build with -Werror enabled (if supported)" ON)
2122

2223
# Define project
2324
project(influxdb-cxx
@@ -35,7 +36,7 @@ if(NOT MSVC AND NOT INCLUDED_AS_SUBPROJECT)
3536
-Wextra
3637
-pedantic
3738
-pedantic-errors
38-
-Werror
39+
$<$<BOOL:${INFLUXCXX_WERROR}>:-Werror>
3940
-Wshadow
4041
-Wold-style-cast
4142
-Wnull-dereference
@@ -68,6 +69,7 @@ message(STATUS "Build Type : ${CMAKE_BUILD_TYPE}")
6869
message(STATUS "Boost support : ${INFLUXCXX_WITH_BOOST}")
6970
message(STATUS "Unit Tests : ${INFLUXCXX_TESTING}")
7071
message(STATUS "System Tests : ${INFLUXCXX_SYSTEMTEST}")
72+
message(STATUS "Werror : ${INFLUXCXX_WERROR}")
7173

7274

7375
# Add coverage flags

0 commit comments

Comments
 (0)