From 1446f559cc238296f76000a4550ad9656d12878b Mon Sep 17 00:00:00 2001 From: Erik Hofman Date: Sun, 26 Mar 2017 10:17:10 +0200 Subject: [PATCH] Add -fPIC to make FlightGear's shared library linking for fgtestlib happy --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d7c6302c..419d335d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -344,8 +344,8 @@ if (NOT ${HAVE_STD_ISNAN}) endif() if(CMAKE_COMPILER_IS_GNUCXX) - set(WARNING_FLAGS_CXX "-Wall") - set(WARNING_FLAGS_C "-Wall") + set(WARNING_FLAGS_CXX "-Wall -fPIC") + set(WARNING_FLAGS_C "-Wall -fPIC") if (CMAKE_VERSION VERSION_LESS 3.1) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") @@ -372,8 +372,8 @@ endif(CMAKE_COMPILER_IS_GNUCXX) if (CLANG) # Boost redeclares class members - set(WARNING_FLAGS_CXX "-Wall -Wno-overloaded-virtual -Wno-redeclared-class-member") - set(WARNING_FLAGS_C "-Wall") + set(WARNING_FLAGS_CXX "-Wall -fPIC -Wno-overloaded-virtual -Wno-redeclared-class-member") + set(WARNING_FLAGS_C "-Wall -fPIC") set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") # fix Boost compilation :( set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")