From 5a982d61c94c9d2e2c23443b9c39ee7696ca5759 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Mon, 19 Dec 2022 14:05:44 +0100 Subject: [PATCH] Build parson with PIC --- src/CMakeLists.txt | 4 ++++ src/rt/CMakeLists.txt | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a7bcb60..89fc089 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,6 +5,10 @@ add_subdirectory(include) add_library(parson STATIC parson.c) target_include_directories(parson PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") +set_property(TARGET parson PROPERTY POSITION_INDEPENDENT_CODE ON) + +add_library(parson-static STATIC parson.c) +target_include_directories(parson-static PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") configure_file("config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/config.h" ) include_directories(${CMAKE_CURRENT_BINARY_DIR}) diff --git a/src/rt/CMakeLists.txt b/src/rt/CMakeLists.txt index 0ce4af8..d9f2df8 100644 --- a/src/rt/CMakeLists.txt +++ b/src/rt/CMakeLists.txt @@ -11,7 +11,7 @@ set_target_properties(ovni PROPERTIES SOVERSION 1) add_library(ovni-static STATIC ovni.c) -target_link_libraries(ovni-static parson) +target_link_libraries(ovni-static parson-static) target_include_directories(ovni-static PUBLIC "${CMAKE_SOURCE_DIR}/include") install(TARGETS ovni LIBRARY DESTINATION lib)