Skip to content

Commit

Permalink
Add noexecstack linker flags (#1852)
Browse files Browse the repository at this point in the history
* add noexecstack linker flags

* fix(build): only apply noexecstack linker flag to linux
  • Loading branch information
igormp authored Feb 25, 2025
1 parent 6a3dc63 commit 11ed2ac
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /d2FH4-")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
if(NOT APPLE)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,noexecstack")
endif()
endif()

find_package(Threads)
Expand Down

0 comments on commit 11ed2ac

Please sign in to comment.