mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-11-26 11:04:18 +01:00
rely on distro policy to make executable PIE, but do enforce noexecstack on final output (#490)
This commit is contained in:
parent
e9d10a9581
commit
4442efa8ac
@ -34,13 +34,6 @@ elseif(UNIX)
|
|||||||
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||||
add_compile_options(-Wno-ambiguous-reversed-operator)
|
add_compile_options(-Wno-ambiguous-reversed-operator)
|
||||||
endif()
|
endif()
|
||||||
# most linux environments should enable pie by default, but make sure just in case.
|
|
||||||
# the same cannot be said for no executable stack which some linkers
|
|
||||||
# and configurations thereof might enable due to the assembly in the project
|
|
||||||
if(NOT APPLE)
|
|
||||||
add_compile_options(-fpie)
|
|
||||||
add_link_options(-pie -z noexecstack)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_compile_options(-Wno-multichar -Wno-invalid-offsetof -Wno-switch -Wno-ignored-attributes -Wno-deprecated-enum-enum-conversion)
|
add_compile_options(-Wno-multichar -Wno-invalid-offsetof -Wno-switch -Wno-ignored-attributes -Wno-deprecated-enum-enum-conversion)
|
||||||
endif()
|
endif()
|
||||||
@ -129,6 +122,12 @@ target_link_libraries(CemuBin PRIVATE
|
|||||||
SDL2::SDL2
|
SDL2::SDL2
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(UNIX AND NOT APPLE)
|
||||||
|
# due to nasm output some linkers will make stack executable.
|
||||||
|
# cemu does not require this so we explicity disable it.
|
||||||
|
target_link_options(CemuBin PRIVATE -z noexecstack)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (ENABLE_WXWIDGETS)
|
if (ENABLE_WXWIDGETS)
|
||||||
target_link_libraries(CemuBin PRIVATE wx::base wx::core)
|
target_link_libraries(CemuBin PRIVATE wx::base wx::core)
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
Reference in New Issue
Block a user