File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ set (JINJA2CPP_DEPS_MODE "external" CACHE STRING "Jinja2Cpp dependency managemen
1919option (JINJA2CPP_BUILD_TESTS "Build Jinja2Cpp unit tests" ${JINJA2CPP_IS_MAIN_PROJECT} )
2020option (JINJA2CPP_STRICT_WARNINGS "Enable additional warnings and treat them as errors" ON )
2121option (JINJA2CPP_BUILD_SHARED "Build shared linkage version of Jinja2Cpp" OFF )
22+ option (JINJA2CPP_PIC "Control -fPIC option for library build" OFF )
2223
2324if (NOT JINJA2CPP_DEPS_MODE)
2425 set (JINJA2CPP_DEPS_MODE "internal" )
@@ -69,8 +70,10 @@ if(NOT ${JINJA2CPP_WITH_SANITIZERS} STREQUAL "none")
6970endif ()
7071
7172if (UNIX )
72- set (GCC_CXX_FLAGS ${GCC_CXX_FLAGS} -fPIC)
73- set (CLANG_CXX_FLAGS ${CLANG_CXX_FLAGS} -fPIC)
73+ if (JINJA2CPP_PIC OR CONAN_CMAKE_POSITION_INDEPENDENT_CODE)
74+ set (GCC_CXX_FLAGS ${GCC_CXX_FLAGS} -fPIC)
75+ set (CLANG_CXX_FLAGS ${CLANG_CXX_FLAGS} -fPIC)
76+ endif ()
7477else ()
7578 set (GCC_CXX_FLAGS ${GCC_CXX_FLAGS} "-Wa,-mbig-obj" -O1)
7679 if (${CMAKE_CXX_COMPILER_ID} MATCHES "GNU" )
You can’t perform that action at this time.
0 commit comments