Skip to content

Commit

Permalink
fix compiler error: "_FORTIFY_SOURCE" redefined (#650)
Browse files Browse the repository at this point in the history
* undefine FORTIFY_SOURCE in project to let distro deside (often defined by compiler)

* Update CMakeLists.txt

Co-authored-by: sgpires <[email protected]>

---------

Co-authored-by: Maik Brenke <[email protected]>
Co-authored-by: Fábio Monteiro <[email protected]>
Co-authored-by: sgpires <[email protected]>
  • Loading branch information
4 people authored Mar 22, 2024
1 parent 55284c5 commit 38f9c54
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ endif()

set(NO_DEPRECATED "")
set(OPTIMIZE "")
set(OS_CXX_FLAGS "${OS_CXX_FLAGS} -D_GLIBCXX_USE_NANOSLEEP -pthread -O -Wall -Wextra -Wformat -Wformat-security -Wconversion -fexceptions -fstrict-aliasing -fstack-protector-strong -fasynchronous-unwind-tables -fno-omit-frame-pointer -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Wpedantic -Werror -fPIE")
if(NOT DEFINED _FORTIFY_SOURCE)
set(_FORTIFY_SOURCE 2)
endif()
set(OS_CXX_FLAGS "${OS_CXX_FLAGS} -D_GLIBCXX_USE_NANOSLEEP -pthread -O -Wall -Wextra -Wformat -Wformat-security -Wconversion -fexceptions -fstrict-aliasing -fstack-protector-strong -fasynchronous-unwind-tables -fno-omit-frame-pointer -D_FORTIFY_SOURCE=${_FORTIFY_SOURCE} -Wformat -Wformat-security -Wpedantic -Werror -fPIE")

# force all use of std::mutex and std::recursive_mutex to use runtime init
# instead of static initialization so mutexes can be hooked to enable PI as needed
Expand Down

0 comments on commit 38f9c54

Please sign in to comment.