mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-22 18:59:59 +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
@ -74,11 +74,27 @@ foreach(lib screen dom component)
|
||||
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