From 29930a028df0e92e6cec778f461194acc16d9c04 Mon Sep 17 00:00:00 2001 From: hsorby Date: Wed, 27 Apr 2022 09:26:34 +1200 Subject: [PATCH] Set position independent code on when building static library. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 87711cb..3139e95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -340,6 +340,7 @@ if (WIN32) endif() if(NOT BUILD_SHARED_LIBS) target_compile_definitions(xml2 PUBLIC LIBXML_STATIC) + set_target_properties(xml2 PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() if(WITH_THREADS) target_compile_definitions(xml2 PRIVATE _REENTRANT)