mirror of
https://github.com/wjwwood/serial.git
synced 2026-01-22 19:54:57 +08:00
compile with -fPIC and bump cmake version
This couldn't be cherry-picked because but essentially the same change
from the ros2 branch here:
d8d160678a
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 <alex.moriarty@picknik.ai>
This commit is contained in:
parent
30259398ae
commit
380c4e4117
@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 2.8.3)
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
project(serial)
|
||||
|
||||
if(APPLE)
|
||||
@ -28,6 +28,9 @@ endif()
|
||||
|
||||
## Add serial library
|
||||
add_library(${PROJECT_NAME} ${serial_SRCS})
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||
POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
if(APPLE)
|
||||
target_link_libraries(${PROJECT_NAME} ${FOUNDATION_LIBRARY} ${IOKIT_LIBRARY})
|
||||
elseif(UNIX)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user