File tree 1 file changed +7
-0
lines changed
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,9 @@ option(SPDLOG_BUILD_SHARED "Build shared library" OFF)
61
61
# precompiled headers option
62
62
option (SPDLOG_ENABLE_PCH "Build static or shared library using precompiled header to speed up compilation time" OFF )
63
63
64
+ # build position independent code
65
+ option (SPDLOG_BUILD_PIC "Build position independent code (-fPIC)" OFF )
66
+
64
67
# example options
65
68
option (SPDLOG_BUILD_EXAMPLE "Build example" ${SPDLOG_MASTER_PROJECT} )
66
69
option (SPDLOG_BUILD_EXAMPLE_HO "Build header only example" OFF )
@@ -132,6 +135,10 @@ if(SPDLOG_TIDY)
132
135
message (STATUS "Enabled clang-tidy" )
133
136
endif ()
134
137
138
+ if (SPDLOG_BUILD_PIC)
139
+ set (CMAKE_POSITION_INDEPENDENT_CODE ON )
140
+ endif ()
141
+
135
142
find_package (Threads REQUIRED)
136
143
message (STATUS "Build type: " ${CMAKE_BUILD_TYPE} )
137
144
# ---------------------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments