From 36187632f41f7f995580c35657ceaeaf2c47aa7a Mon Sep 17 00:00:00 2001 From: derek Date: Thu, 23 Jun 2011 15:35:35 -0400 Subject: [PATCH] Fixed -fPIC issue for CentOS users. * Forced compiler flag that was not being automatically set by CMake on that OS. Had previously set this on API library. Got feedback that it worked there, so I added the flag to Utils & JsonCPP libs as well. --- src/api/CMakeLists.txt | 2 +- src/third_party/jsoncpp/CMakeLists.txt | 1 + src/utils/CMakeLists.txt | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/api/CMakeLists.txt b/src/api/CMakeLists.txt index 9ba9963..39864c7 100644 --- a/src/api/CMakeLists.txt +++ b/src/api/CMakeLists.txt @@ -10,7 +10,7 @@ include_directories( ${BamTools_SOURCE_DIR}/src ) # add compiler definitions add_definitions( -DBAMTOOLS_API_LIBRARY ) # (for proper exporting of library symbols) -add_definitions( -fPIC ) # (attempt to force PIC compiling on some archs) +add_definitions( -fPIC ) # (attempt to force PIC compiling on CentOS, not being set on shared libs by CMake) # list of all BamTools API source (.cpp) files set( BamToolsAPISources diff --git a/src/third_party/jsoncpp/CMakeLists.txt b/src/third_party/jsoncpp/CMakeLists.txt index 3fc9ec4..9cc442a 100644 --- a/src/third_party/jsoncpp/CMakeLists.txt +++ b/src/third_party/jsoncpp/CMakeLists.txt @@ -7,6 +7,7 @@ # add compiler definitions add_definitions(-DBAMTOOLS_JSONCPP_LIBRARY) # (for proper exporting of library symbols) +add_definitions( -fPIC ) # (attempt to force PIC compiling on CentOS, not being set on shared libs by CMake) # create jsoncpp library add_library ( jsoncpp SHARED diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt index 5bbe624..fab013a 100644 --- a/src/utils/CMakeLists.txt +++ b/src/utils/CMakeLists.txt @@ -10,6 +10,7 @@ include_directories (${BamTools_SOURCE_DIR}/src/api) # add compiler definitions add_definitions(-DBAMTOOLS_UTILS_LIBRARY) # (for proper exporting of library symbols) +add_definitions( -fPIC ) # (attempt to force PIC compiling on CentOS, not being set on shared libs by CMake) # create BamTools utils library add_library ( BamTools-utils SHARED -- 2.39.2