celix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ferry Huberts <maili...@hupie.com>
Subject [PATCH v1 2/3] add -fPIC to remote services
Date Fri, 22 Jun 2012 08:50:43 GMT
From: Ferry Huberts <ferry.huberts@pelagic.nl>

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
---
 remote_services/CMakeLists.txt |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/remote_services/CMakeLists.txt b/remote_services/CMakeLists.txt
index 03892d9..78b5bde 100644
--- a/remote_services/CMakeLists.txt
+++ b/remote_services/CMakeLists.txt
@@ -15,6 +15,18 @@
 # specific language governing permissions and limitations
 # under the License.
 
+# Add -fPIC for x86_64 Unix platforms; this lib will be linked to a shared lib
+if(UNIX AND NOT WIN32)
+  find_program(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin )
+  if(CMAKE_UNAME)
+    exec_program(uname ARGS -m OUTPUT_VARIABLE CMAKE_SYSTEM_PROCESSOR)
+    set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR} CACHE INTERNAL "processor type (i386
and x86_64)")
+     if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
+      add_definitions(-fPIC)
+    endif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
+  endif(CMAKE_UNAME)
+endif(UNIX AND NOT WIN32)
+
 #add_subdirectory(mongoose)
 add_subdirectory(utils)
 
-- 
1.7.10.2


Mime
View raw message