From 877c4724d8919e11dd06ca15234e3a0d4e030197 Mon Sep 17 00:00:00 2001 From: zhupengfei Date: Tue, 23 Jun 2020 22:07:51 +0800 Subject: [PATCH] frontend: Add `-no-pie` for Linux --- src/frontend/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/frontend/CMakeLists.txt b/src/frontend/CMakeLists.txt index 2b97b03..ffcdf22 100644 --- a/src/frontend/CMakeLists.txt +++ b/src/frontend/CMakeLists.txt @@ -47,6 +47,9 @@ elseif(WIN32) elseif(MINGW) set_target_properties(threeSD PROPERTIES LINK_FLAGS_RELEASE "-mwindows") endif() +elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") + # In Ubuntu, the executable would be recognized as a shared library otherwise. + target_link_options(threeSD PRIVATE "-no-pie") endif() target_compile_definitions(threeSD PRIVATE