mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-22 10:40:00 +08:00
Use globally set CMAKE_CXX_STANDARD if it is set (#620)
This commit is contained in:
parent
4ce8f6d250
commit
1a7a550bfe
@ -43,9 +43,17 @@ function(ftxui_set_options library)
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
)
|
||||
|
||||
# Play nicely if we are being consumed by another project
|
||||
# and use their CMAKE_CXX_STANDARD. Otherwise, fall back to 17
|
||||
# C++17 is used. We require fold expression at least.
|
||||
if (DEFINED CMAKE_CXX_STANDARD)
|
||||
set(CXX_STANDARD ${CMAKE_CXX_STANDARD})
|
||||
else()
|
||||
set(CXX_STANDARD 17)
|
||||
endif()
|
||||
|
||||
set_target_properties(${library} PROPERTIES
|
||||
CXX_STANDARD 17
|
||||
CXX_STANDARD ${CXX_STANDARD}
|
||||
CXX_EXTENSIONS OFF
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user