Skip to content
Snippets Groups Projects
Commit 3d5285ba authored by 数学の武士's avatar 数学の武士
Browse files

Add compiler keys for cmake Debug build type

parent 686f4408
No related branches found
No related tags found
No related merge requests found
......@@ -140,14 +140,7 @@ endif(USE_CXX OR INCLUDE_CUDA)
set(SOURCES ${MEMPROC_HEADERS_CU} ${MEMPROC_SOURCES_CU} ${MEMPROC_HEADERS_CXX} ${MEMPROC_SOURCES_CXX} ${HEADERS_CU} ${SOURCES_CU} ${HEADERS_C} ${HEADERS_CXX} ${SOURCES_CXX} ${SOURCES_C} ${HEADERS_F} ${SOURCES_F})
set(CMAKE_Fortran_FLAGS " -g -fbacktrace -ffpe-trap=zero,overflow,underflow -cpp ")
if(USE_CXX OR INCLUDE_CUDA)
set(CMAKE_CXX_FLAGS " -g -Wunused-variable ")
set(CMAKE_C_FLAGS " -g ")
set(CMAKE_CUDA_FLAGS " -g ")
endif(USE_CXX OR INCLUDE_CUDA)
set(CMAKE_Fortran_FLAGS " -cpp ")
add_executable(sfx ${SOURCES})
set_property(TARGET sfx PROPERTY LINKER_LANGUAGE Fortran)
......@@ -158,6 +151,18 @@ if(USE_CONFIG_PARSER)
target_link_libraries(sfx config_parser_F config_parser_CXX)
endif(USE_CONFIG_PARSER)
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
target_compile_options(sfx
PUBLIC $<$<COMPILE_LANGUAGE:C>: -g >)
target_compile_options(sfx
PUBLIC $<$<COMPILE_LANGUAGE:CXX>: -g >)
target_compile_options(sfx
PUBLIC $<$<COMPILE_LANGUAGE:CUDA>: -g >)
target_compile_options(sfx
PUBLIC $<$<COMPILE_LANGUAGE:Fortran>: -g -fbacktrace -ffpe-trap=zero,overflow,underflow >)
endif()
# copy data & configs on post build
add_custom_command(
TARGET sfx POST_BUILD
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment