cmake: Disable char8_t when using C++20

This commit is contained in:
derrod 2023-07-02 06:09:20 +02:00 committed by Lain
parent 914951a28d
commit 8d33da1fab
2 changed files with 8 additions and 0 deletions

View File

@ -74,6 +74,10 @@ set(_obs_clang_cxx_options
-Werror=block-capture-autoreleasing
-Wrange-loop-analysis)
if(CMAKE_CXX_STANDARD GREATER_EQUAL 20)
list(APPEND _obs_clang_cxx_options -fno-char8_t)
endif()
if(NOT DEFINED CMAKE_COMPILE_WARNING_AS_ERROR)
set(CMAKE_COMPILE_WARNING_AS_ERROR ON)
endif()

View File

@ -37,6 +37,10 @@ set(_obs_msvc_c_options /Brepro /MP /permissive- /Zc:__cplusplus /Zc:preprocesso
set(_obs_msvc_cpp_options /Brepro /MP /permissive- /Zc:__cplusplus /Zc:preprocessor)
if(CMAKE_CXX_STANDARD GREATER_EQUAL 20)
list(APPEND _obs_msvc_cpp_options /Zc:char8_t-)
endif()
add_compile_options(
/W3
/utf-8