Skip to content

Commit 380c4e4

Browse files
committed
compile with -fPIC and bump cmake version
This couldn't be cherry-picked because but essentially the same change from the ros2 branch here: tylerjw@d8d1606 Fixes this error: ``` /usr/bin/ld: /home/alex/ros/h/robotiq/install/serial/lib/libserial.a(serial.cc.o): relocation R_X86_64_PC32 against symbol `_ZTVN6serial6SerialE' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: bad value ``` Signed-off-by: Alex Moriarty <[email protected]>
1 parent 3025939 commit 380c4e4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 2.8.3)
1+
cmake_minimum_required(VERSION 2.8.12)
22
project(serial)
33

44
if(APPLE)
@@ -28,6 +28,9 @@ endif()
2828

2929
## Add serial library
3030
add_library(${PROJECT_NAME} ${serial_SRCS})
31+
set_target_properties(${PROJECT_NAME} PROPERTIES
32+
POSITION_INDEPENDENT_CODE ON)
33+
3134
if(APPLE)
3235
target_link_libraries(${PROJECT_NAME} ${FOUNDATION_LIBRARY} ${IOKIT_LIBRARY})
3336
elseif(UNIX)

0 commit comments

Comments
 (0)