From 082897eff58e1e4c7c6cfa0303a5c706d1873a81 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 14 Jul 2019 12:38:23 +0100 Subject: [PATCH] Set PIC everywhere --- CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 48fa61ed2..4b33a37b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,9 +112,8 @@ add_subdirectory(vendor/cxxopts) add_subdirectory(vendor/nlohmann) include_directories(SYSTEM vendor/cxxopts/include) -if (NOT WIN32) - add_compile_options(-fPIC) -endif(NOT WIN32) +# Always build PIC +set(CMAKE_POSITION_INDEPENDENT_CODE ON) if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wno-unknown-warning-option)