We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9755f7a commit 6b536a2Copy full SHA for 6b536a2
1 file changed
CMakeLists.txt
@@ -29,6 +29,18 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
29
include(GNUInstallDirs)
30
include(UseLibCXX)
31
32
+if (CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
33
+ set(IRODS_BUILD_WITH_WERROR_DEFAULT ON)
34
+else()
35
+ set(IRODS_BUILD_WITH_WERROR_DEFAULT OFF)
36
+endif()
37
+
38
+set(IRODS_BUILD_WITH_WERROR ${IRODS_BUILD_WITH_WERROR_DEFAULT} CACHE BOOL "Choose whether to compile with -Werror.")
39
40
+if (IRODS_BUILD_WITH_WERROR)
41
+ add_compile_options(-Werror)
42
43
44
if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
45
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build {Debug, Release}." FORCE)
46
message(STATUS "Setting unspecified CMAKE_BUILD_TYPE to '${CMAKE_BUILD_TYPE}'")
0 commit comments