Skip to content

Commit

Permalink
fix(build): only apply noexecstack linker flag to linux
Browse files Browse the repository at this point in the history
  • Loading branch information
igormp committed Feb 19, 2025
1 parent c7ec0b1 commit 3a20414
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /d2FH4-")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,noexecstack")
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 3a20414

Please sign in to comment.