diff --git a/CMakeLists.txt b/CMakeLists.txt index 25e6245..130fc53 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,9 @@ set(GENERIC_LIB_SOVERSION "6") option(BUILD_SHARED_LIBS "build as shared library" ON) option(BUILD_TESTS "build xmltest (deprecated: Use BUILD_TESTING)" ON) +# To allow using tinyxml in another shared library +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + set(CMAKE_CXX_VISIBILITY_PRESET hidden) set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) diff --git a/Makefile b/Makefile index 66b1bc9..5989b95 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ ARFLAGS = cr RM = rm -f RANLIB = ranlib MKDIR = mkdir -p +CXXFLAGS = -fPIC INSTALL = install INSTALL_PROGRAM = $(INSTALL)