Farmhash as Position Independent Static Library (#365)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Tue, 26 Jun 2018 06:18:28 +0000 (15:18 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Tue, 26 Jun 2018 06:18:28 +0000 (15:18 +0900)
This commit revises FarmhashConfig module to insert -fPIC option when
building libfarmhash.a. This option will allow farmhash library to be linked
into shared libraries.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
cmake/packages/FarmhashConfig.cmake

index 7c88aac..5bea464 100644 (file)
@@ -8,6 +8,7 @@ function(_Farmhash_import)
 
   if(NOT TARGET farmhash)
     add_library(farmhash "${FarmhashSource_DIR}/src/farmhash.cc")
+    set_target_properties(farmhash PROPERTIES POSITION_INDEPENDENT_CODE ON)
     target_include_directories(farmhash PUBLIC "${FarmhashSource_DIR}/src")
   endif(NOT TARGET farmhash)