Skip to content

Commit 684df60

Browse files
committed
CMake: Add warnings.
1 parent f2bdf27 commit 684df60

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ if (NOT EXISTS "${CMAKE_SOURCE_DIR}/src/whereami/.git" )
1313
message(FATAL_ERROR "The src/whereami git submodule is not initialised.\n Please run `git submodule update --init`")
1414
endif()
1515

16+
# add warnings
17+
if (MSVC)
18+
add_compile_options(/W4)
19+
# not yet: make warnings fatal
20+
#add_compile_options(/W4 /WX)
21+
else()
22+
add_compile_options(-Wall -Wextra -pedantic)
23+
# not yet: make warnings fatal
24+
#add_compile_options(-Wall -Wextra -pedantic -Werror)
25+
endif()
26+
1627
# create version string based on git metadata (based on https://github.com/nocnokneo/cmake-git-versioning-example)
1728
# in case version.hpp does not exist (it is shipped in GDL tarballs but not stored in the repo)
1829
if (NOT EXISTS "${CMAKE_SOURCE_DIR}/src/version.hpp")

0 commit comments

Comments
 (0)