mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 16:35:45 +08:00
Merge pull request #2475 from nigels-com/-fPIC
cmake: set(CMAKE_POSITION_INDEPENDENT_CODE ON)
This commit is contained in:
commit
81de01c02c
@ -61,6 +61,9 @@ option(SPDLOG_BUILD_SHARED "Build shared library" OFF)
|
||||
# precompiled headers option
|
||||
option(SPDLOG_ENABLE_PCH "Build static or shared library using precompiled header to speed up compilation time" OFF)
|
||||
|
||||
# build position independent code
|
||||
option(SPDLOG_BUILD_PIC "Build position independent code (-fPIC)" OFF)
|
||||
|
||||
# example options
|
||||
option(SPDLOG_BUILD_EXAMPLE "Build example" ${SPDLOG_MASTER_PROJECT})
|
||||
option(SPDLOG_BUILD_EXAMPLE_HO "Build header only example" OFF)
|
||||
@ -132,6 +135,10 @@ if(SPDLOG_TIDY)
|
||||
message(STATUS "Enabled clang-tidy")
|
||||
endif()
|
||||
|
||||
if(SPDLOG_BUILD_PIC)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
endif()
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
message(STATUS "Build type: " ${CMAKE_BUILD_TYPE})
|
||||
# ---------------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user