Skip to content

Commit e5561f7

Browse files
committed
don't force CMAKE_BUILD_TYPE
On old compilers like GCC-7, -O2 works but -O3 segfaults on attributes. When forcing CMAKE_BUILD_TYPE, then user CMAKE_Fortran_FLAGS can't override -O3
1 parent c2f51ac commit e5561f7

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

CMakeLists.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
55
cmake -Bbuild")
66
endif()
77

8-
get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
9-
if(NOT is_multi_config AND NOT (CMAKE_BUILD_TYPE OR DEFINED ENV{CMAKE_BUILD_TYPE}))
10-
set(CMAKE_BUILD_TYPE Release CACHE STRING "Release default")
11-
endif()
12-
138
project(h5fortran
149
LANGUAGES C Fortran
1510
VERSION 4.10.6
@@ -86,6 +81,14 @@ install(TARGETS h5fortran EXPORT h5fortran-targets)
8681

8782
add_subdirectory(src)
8883

84+
get_property(_h5f_defs TARGET h5fortran PROPERTY COMPILE_DEFINITIONS)
85+
message(VERBOSE "h5fortran COMPILE_DEFINITIONS: ${_h5f_defs}")
86+
get_property(_h5f_flags TARGET h5fortran PROPERTY COMPILE_OPTIONS)
87+
message(VERBOSE "h5fortran COMPILE_OPTIONS: ${_h5f_flags}")
88+
get_property(_h5f_libs TARGET h5fortran PROPERTY LINK_LIBRARIES)
89+
message(VERBOSE "h5fortran LINK_LIBRARIES: ${_h5f_libs}")
90+
91+
8992
if(h5fortran_BUILD_TESTING)
9093
add_subdirectory(test)
9194
endif()

0 commit comments

Comments
 (0)