Skip to content
Snippets Groups Projects
Commit b63f37ab authored by Automated MSK Jenkins User's avatar Automated MSK Jenkins User
Browse files

Merge remote-tracking branch 'project-template/master'

parents 066c3b3a 458f4da7
No related branches found
No related tags found
No related merge requests found
...@@ -25,22 +25,16 @@ ...@@ -25,22 +25,16 @@
# #
####################################################################################################################### #######################################################################################################################
string(TOUPPER "${ENABLE_TSAN}" enable_tsanitizer_uppercase) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 --coverage")
IF(enable_tsanitizer_uppercase STREQUAL "TRUE") # The make coverage command is only available in debug mode. Also
message(WARNING "The ENABLE_TSAN set to true. Code coverage cannot be enabled, becasue it requires -O0 flag and ENABLE_TSAN requires -O1.") # factor in that cmake treats CMAKE_BUILD_TYPE string as case
ELSE() # insensitive.
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 --coverage") string(TOUPPER "${CMAKE_BUILD_TYPE}" build_type_uppercase)
# The make coverage command is only available in debug mode. Also IF(build_type_uppercase STREQUAL "DEBUG")
# factor in that cmake treats CMAKE_BUILD_TYPE string as case configure_file(cmake/make_coverage.sh.in
# insensitive. ${PROJECT_BINARY_DIR}/make_coverage.sh @ONLY)
string(TOUPPER "${CMAKE_BUILD_TYPE}" build_type_uppercase) add_custom_target(coverage
IF(build_type_uppercase STREQUAL "DEBUG") ./make_coverage.sh
configure_file(cmake/make_coverage.sh.in WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_BINARY_DIR}/make_coverage.sh @ONLY) COMMENT "Generating test coverage documentation" VERBATIM)
add_custom_target(coverage
./make_coverage.sh
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating test coverage documentation" VERBATIM)
ENDIF()
ENDIF() ENDIF()
...@@ -22,18 +22,18 @@ ...@@ -22,18 +22,18 @@
####################################################################################################################### #######################################################################################################################
include(cmake/enable_latest_cxx_support.cmake) include(cmake/enable_latest_cxx_support.cmake)
set(CMAKE_CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo;asan;tsan")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${${PROJECT_NAME}_CXX_FLAGS} -Wall -Wextra -Wshadow -pedantic -Wuninitialized") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${${PROJECT_NAME}_CXX_FLAGS} -Wall -Wextra -Wshadow -pedantic -Wuninitialized")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3 -g") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3 -g")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0 --coverage")
set(CMAKE_CXX_FLAGS_TSAN "${CMAKE_CXX_FLAGS} -g -O1 -fsanitize=thread")
set(CMAKE_CXX_FLAGS_ASAN "${CMAKE_CXX_FLAGS} -g -O0 -fsanitize=address -fsanitize=undefined -fsanitize=leak")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${${PROJECT_NAME}_C_FLAGS} -Wall -Wextra -Wshadow -pedantic -Wuninitialized") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${${PROJECT_NAME}_C_FLAGS} -Wall -Wextra -Wshadow -pedantic -Wuninitialized")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3") set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -O3 -g") set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -O3 -g")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g -O0 --coverage")
string(TOUPPER "${ENABLE_TSAN}" enable_tsanitizer_uppercase) set(CMAKE_C_FLAGS_TSAN "${CMAKE_C_FLAGS} -g -O1 -fsanitize=thread")
IF(enable_tsanitizer_uppercase STREQUAL "TRUE") set(CMAKE_C_FLAGS_ASAN "${CMAKE_C_FLAGS} -g -O0 -fsanitize=address -fsanitize=undefined -fsanitize=leak")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O1 -fsanitize=thread")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g -O1 -fsanitize=thread")
ELSE()
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0 --coverage")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g -O0 --coverage")
ENDIF()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment