Skip to content

Commit ea95fa6

Browse files
authored
Merge pull request #43 from sparcians/dev/bdutro/fix-stfpy-debug-compile
Fix an stfpy compilation error that can occur in debug mode on systems that specify -D_FORTIFY_SOURCE
2 parents 9bbe657 + 17266f0 commit ea95fa6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

stfpy/CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
1111
add_link_options(-Wno-unused-command-line-argument -Wno-ignored-optimization-argument)
1212
endif()
1313

14+
# Disable _FORTIFY_SOURCE unless we're in Release mode
15+
if (NOT CMAKE_BUILD_TYPE MATCHES "^[Rr]elease")
16+
add_compile_options(-U_FORTIFY_SOURCE -Wp,-U_FORTIFY_SOURCE)
17+
endif()
18+
1419
get_directory_property(include_dirs INCLUDE_DIRECTORIES)
1520
get_directory_property(compile_opts COMPILE_OPTIONS)
1621
get_directory_property(link_opts LINK_OPTIONS)

0 commit comments

Comments
 (0)