Skip to content

Commit

Permalink
CMake: Workaround newuoa FORTIFY issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jschueller committed Oct 25, 2024
1 parent f22c8bd commit 2e893ae
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,12 @@ set (NLOPT_SOURCES

set_property(SOURCE src/algs/bobyqa/bobyqa.c src/algs/cdirect/hybrid.c src/algs/mma/ccsa_quadratic.c src/algs/cobyla/cobyla.c
src/util/redblack.c src/algs/neldermead/nldrmd.c src/algs/newuoa/newuoa.c src/util/qsort_r.c
PROPERTY SKIP_UNITY_BUILD_INCLUSION ON)
PROPERTY SKIP_UNITY_BUILD_INCLUSION ON)

# workaround for false positive in newuoa
if (CMAKE_C_COMPILER_ID MATCHES "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12)
set_source_files_properties(src/algs/newuoa/newuoa.c PROPERTIES COMPILE_FLAGS -U_FORTIFY_SOURCE)
endif ()

if (NLOPT_CXX)
list (APPEND NLOPT_SOURCES
Expand Down

0 comments on commit 2e893ae

Please sign in to comment.