From 952bcc7e02b47dcf35fc144633a635563a9d4806 Mon Sep 17 00:00:00 2001 From: Ilya Orlov Date: Sat, 2 Jun 2018 01:46:08 +0300 Subject: [PATCH] Add Position-Independed Code option for static build --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e95e6c0..f4fe1cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,6 +41,7 @@ if(BUILD_SHARED_LIBS) add_library(pugixml SHARED ${HEADERS} ${SOURCES}) else() add_library(pugixml STATIC ${HEADERS} ${SOURCES}) + set_property(TARGET pugixml PROPERTY POSITION_INDEPENDENT_CODE ON) endif() # Export symbols for shared library builds