Browse Source

Add -fPIC by default

Alexey Edelev 5 years ago
parent
commit
9f403d6f14
1 changed files with 2 additions and 0 deletions
  1. 2 0
      CMakeLists.txt

+ 2 - 0
CMakeLists.txt

@@ -12,6 +12,8 @@ set(TARGET_LIB_DIR ${CMAKE_INSTALL_LIBDIR})
 set(TARGET_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
 set(TARGET_BINDIR ${CMAKE_INSTALL_BINDIR})
 
+set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
+
 add_library(${TARGET} microjson.cpp)
 set_target_properties(${TARGET} PROPERTIES VERSION ${PROJECT_VERSION} PUBLIC_HEADER "microjson.h" OUTPUT_NAME ${TARGET})
 target_include_directories(${TARGET} PUBLIC