mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-22 10:40:00 +08:00
Require C++17 and force MSVC to treat source as UTF-8
Co-authored-by: Mikael Olenfalk <mikael@olenfalk.se> Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
This commit is contained in:
parent
9ca8d41afc
commit
a1c390ea31
@ -69,16 +69,32 @@ target_link_libraries(component PUBLIC dom Threads::Threads)
|
||||
foreach(lib screen dom component)
|
||||
target_include_directories(${lib}
|
||||
PUBLIC
|
||||
$<INSTALL_INTERFACE:include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
PRIVATE
|
||||
src
|
||||
)
|
||||
|
||||
# C++17 is used. We requires fold expression at least.
|
||||
set_property(TARGET ${lib} PROPERTY CXX_STANDARD 17)
|
||||
target_compile_options(${lib} PRIVATE
|
||||
$<$<CXX_COMPILER_ID:MSVC>:/W4 /WX>
|
||||
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wall -Wextra -pedantic -Werror -Wno-sign-compare>
|
||||
)
|
||||
|
||||
# Force Microsoft Visual Studio to decode sources files in UTF-8. This applies
|
||||
# to the library and the library users.
|
||||
if (MSVC)
|
||||
target_compile_options(${lib} PUBLIC "/utf-8>")
|
||||
endif()
|
||||
|
||||
# Add as many warning as possible:
|
||||
if (MSVC)
|
||||
target_compile_options(${lib} PRIVATE "/W4")
|
||||
target_compile_options(${lib} PRIVATE "/WX")
|
||||
else()
|
||||
target_compile_options(${lib} PRIVATE "-Wall")
|
||||
target_compile_options(${lib} PRIVATE "-Wextra")
|
||||
target_compile_options(${lib} PRIVATE "-pedantic")
|
||||
target_compile_options(${lib} PRIVATE "-Werror")
|
||||
target_compile_options(${lib} PRIVATE "-Wno-sign-compare")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(FTXUI_ENABLE_INSTALL)
|
||||
|
Loading…
Reference in New Issue
Block a user