From 5b062d206417d7f4e82f2f392e9b94c468082191 Mon Sep 17 00:00:00 2001 From: Thomas Fussell Date: Thu, 27 Oct 2016 22:09:10 -0400 Subject: [PATCH] compile third-party lib with -fPIC when building xlnt as shared lib --- third-party/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt index 516530b3..3c4d818e 100644 --- a/third-party/CMakeLists.txt +++ b/third-party/CMakeLists.txt @@ -45,6 +45,11 @@ add_custom_command(OUTPUT ${BOTAN} add_library(xlnt.third-party OBJECT ${MINIZ} ${LIBSTUDXML} ${POLE} ${BOTAN}) target_compile_definitions(xlnt.third-party PRIVATE LIBSTUDXML_STATIC_LIB=1) +if(NOT STATIC) + set_target_properties(xlnt.third-party + PROPERTIES POSITION_INDEPENDENT_CODE 1) +endif() + if(MSVC) target_compile_definitions(xlnt.third-party PRIVATE _CRT_SECURE_NO_WARNINGS=1 NOMINMAX) set_target_properties(xlnt.third-party PROPERTIES COMPILE_FLAGS "/MP")