[F] Fixed build

This commit is contained in:
seleznevae 2018-04-01 16:12:43 +03:00
parent 91ab04d9d7
commit 98349d755e

View File

@ -111,19 +111,19 @@ if(FORT_COMPILER STREQUAL "GNU" OR FORT_COMPILER STREQUAL "Clang")
# asan case # asan case
if(FORT_BUILD_TYPE STREQUAL "asan") if(FORT_BUILD_TYPE STREQUAL "asan")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address")
set(CMAKE_CPP_FLAGS "${CMAKE_CPP_FLAGS} -fsanitize=address") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
if(FORT_COMPILER STREQUAL "GNU") if(FORT_COMPILER STREQUAL "GNU")
target_link_libraries(${PROJECT_NAME}_example asan) target_link_libraries(${PROJECT_NAME}_example asan)
target_link_libraries(${PROJECT_NAME}_test asan) target_link_libraries(${PROJECT_NAME}_test asan)
target_link_libraries(${PROJECT_NAME}_example_cpp asan)
endif(FORT_COMPILER STREQUAL "GNU") endif(FORT_COMPILER STREQUAL "GNU")
target_link_libraries(${PROJECT_NAME}_example_cpp asan)
endif(FORT_BUILD_TYPE STREQUAL "asan") endif(FORT_BUILD_TYPE STREQUAL "asan")
#ubsan case #ubsan case
if(FORT_BUILD_TYPE STREQUAL "ubsan") if(FORT_BUILD_TYPE STREQUAL "ubsan")
# -fno-sanitize-recover option is used to force faild # -fno-sanitize-recover option is used to force faild
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined -fno-sanitize-recover") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined -fno-sanitize-recover")
set(CMAKE_CPP_FLAGS "${CMAKE_CPP_FLAGS} -fsanitize=undefined -fno-sanitize-recover") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined -fno-sanitize-recover")
if(FORT_COMPILER STREQUAL "GNU") if(FORT_COMPILER STREQUAL "GNU")
target_link_libraries(${PROJECT_NAME}_example ubsan) target_link_libraries(${PROJECT_NAME}_example ubsan)
target_link_libraries(${PROJECT_NAME}_example_cpp ubsan) target_link_libraries(${PROJECT_NAME}_example_cpp ubsan)
@ -134,8 +134,8 @@ if(FORT_COMPILER STREQUAL "GNU" OR FORT_COMPILER STREQUAL "Clang")
#coveralls case #coveralls case
if(FORT_BUILD_TYPE STREQUAL "coveralls") if(FORT_BUILD_TYPE STREQUAL "coveralls")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -fprofile-arcs -ftest-coverage") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -fprofile-arcs -ftest-coverage")
set(CMAKE_CPP_FLAGS "${CMAKE_CPP_FLAGS} -g -fprofile-arcs -ftest-coverage") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -fprofile-arcs -ftest-coverage")
target_link_libraries(${PROJECT_NAME}_example_cpp gcov) #target_link_libraries(${PROJECT_NAME}_example_cpp gcov)
endif(FORT_BUILD_TYPE STREQUAL "coveralls") endif(FORT_BUILD_TYPE STREQUAL "coveralls")
endif(FORT_COMPILER STREQUAL "GNU" OR FORT_COMPILER STREQUAL "Clang") endif(FORT_COMPILER STREQUAL "GNU" OR FORT_COMPILER STREQUAL "Clang")