Skip to content

Commit 36756f5

Browse files
committed
Fix Issue #150
1 parent 17e5a70 commit 36756f5

2 files changed

Lines changed: 24 additions & 3 deletions

File tree

cmake/modules/clang.cmake

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,28 @@ if((NOT CMAKE_BUILD_TYPE) OR (CMAKE_BUILD_TYPE STREQUAL "Release"))
3232
set(OPTIMISATION_FLAGS "-O2 -DNDEBUG ${OPTIMISATION_FLAGS}")
3333
endif((NOT CMAKE_BUILD_TYPE) OR (CMAKE_BUILD_TYPE STREQUAL "Release"))
3434

35-
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
36-
add_definitions("-g")
37-
endif(CMAKE_BUILD_TYPE STREQUAL "Debug")
35+
option(enable-glibcxx-debug "use the debug version of the C++ standard as implemented by the glib C++ library" OFF)
36+
if(enable-glibcxx-debug)
37+
if(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
38+
set(CMAKE_CXX_FLAGS_DEBUG "-g -D_GLIBCXX_DEBUG -Rno-debug-disables-optimization" CACHE STRING
39+
"Flags used by the C++ compiler during debug builds."
40+
FORCE)
41+
else(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
42+
set(CMAKE_CXX_FLAGS_DEBUG "-g -D_GLIBCXX_DEBUG" CACHE STRING
43+
"Flags used by the C++ compiler during debug builds."
44+
FORCE)
45+
endif(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
46+
else(enable-glibcxx-debug)
47+
if(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
48+
set(CMAKE_CXX_FLAGS_DEBUG "-g -Rno-debug-disables-optimization" CACHE STRING
49+
"Flags used by the C++ compiler during debug builds."
50+
FORCE)
51+
else(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
52+
set(CMAKE_CXX_FLAGS_DEBUG "-g" CACHE STRING
53+
"Flags used by the C++ compiler during debug builds."
54+
FORCE)
55+
endif(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
56+
endif(enable-glibcxx-debug)
3857

3958
if(HAVE_FORTRAN)
4059
# we associate clang with the gnu fortran compiler

cmake/modules/nvhpc.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
77
add_definitions("-g")
88
endif(CMAKE_BUILD_TYPE STREQUAL "Debug")
99

10+
add_definitions("-fPIC -Ktrap=fp -Kieee -noswitcherror -std=c++17 -Wno-long-long -Wall -Wshadow -Wextra -Wno-unused-parameter -Werror --display_error_number --diag_suppress1 --diag_suppress185 --diag_suppress941 -Wunused-variable --diag_suppress177 --diag_suppress191")
11+
1012
if(enable-fast-math)
1113
tfel_enable_cxx_compiler_flag(OPTIMISATION_FLAGS "ffinite-math-only")
1214
else(enable-fast-math)

0 commit comments

Comments
 (0)