Skip to content

Commit 03da6db

Browse files
CMakeLists.txt: adding compile flags and static analysis condition
1 parent e92ede3 commit 03da6db

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

CMakeLists.txt

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS on)
3232

3333
include(GNUInstallDirs)
3434

35+
if(STATIC_ANALYSIS)
36+
include(cmake/static_analysis.cmake)
37+
endif()
38+
39+
add_compile_options(
40+
-Wall
41+
-Wextra
42+
-Wpedantic
43+
-Werror
44+
-Wfatal-errors
45+
)
46+
3547
file(GLOB cpp_files "*.cpp")
3648

3749
set(LIBRARY_OBJECTS "")
@@ -42,5 +54,9 @@ foreach(cpp_file ${cpp_files})
4254
endforeach()
4355

4456
add_library(smithlab_cpp)
45-
target_include_directories(smithlab_cpp PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
46-
target_link_libraries(smithlab_cpp PUBLIC ${LIBRARY_OBJECTS})
57+
target_include_directories(smithlab_cpp PUBLIC
58+
${CMAKE_CURRENT_SOURCE_DIR}
59+
)
60+
target_link_libraries(smithlab_cpp PUBLIC
61+
${LIBRARY_OBJECTS}
62+
)

0 commit comments

Comments
 (0)