compile third-party lib with -fPIC when building xlnt as shared lib

This commit is contained in:
Thomas Fussell 2016-10-27 22:09:10 -04:00
parent 3c7c40cdfa
commit 5b062d2064

View File

@ -45,6 +45,11 @@ add_custom_command(OUTPUT ${BOTAN}
add_library(xlnt.third-party OBJECT ${MINIZ} ${LIBSTUDXML} ${POLE} ${BOTAN}) add_library(xlnt.third-party OBJECT ${MINIZ} ${LIBSTUDXML} ${POLE} ${BOTAN})
target_compile_definitions(xlnt.third-party PRIVATE LIBSTUDXML_STATIC_LIB=1) 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) if(MSVC)
target_compile_definitions(xlnt.third-party PRIVATE _CRT_SECURE_NO_WARNINGS=1 NOMINMAX) target_compile_definitions(xlnt.third-party PRIVATE _CRT_SECURE_NO_WARNINGS=1 NOMINMAX)
set_target_properties(xlnt.third-party PROPERTIES COMPILE_FLAGS "/MP") set_target_properties(xlnt.third-party PROPERTIES COMPILE_FLAGS "/MP")