From 9a91d037ab878c150abd89758cb10469e76040a5 Mon Sep 17 00:00:00 2001 From: grasmanek94 Date: Mon, 18 Sep 2023 01:47:08 +0200 Subject: [PATCH] Linux position independent code -fpic --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ae43d73..ee54d789 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,8 @@ if(MSVC) add_definitions(/MP) # Enable EHa #string(REGEX REPLACE "/EHsc" "/EHa" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +else() + set(CMAKE_POSITION_INDEPENDENT_CODE ON) endif() SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/)