mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-28 22:26:28 +08:00
Improved CMake PIC compile option management
This commit is contained in:
parent
d0e10d3b73
commit
39df8929de
@ -49,9 +49,11 @@ function(ftxui_set_options library)
|
|||||||
target_compile_options(${library} PUBLIC "/utf-8")
|
target_compile_options(${library} PUBLIC "/utf-8")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(UNIX)
|
# CMake does automatically add -fPIC when linking a shared library, but it
|
||||||
target_compile_options(${library} PRIVATE "-fPIC")
|
# does not add it when linking a static library. This is a problem when the
|
||||||
endif()
|
# static library is later linked into a shared library.
|
||||||
|
# Doing it helps some users.
|
||||||
|
set_property(TARGET ${library} PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||||
|
|
||||||
# Add as many warning as possible:
|
# Add as many warning as possible:
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
|
Loading…
Reference in New Issue
Block a user