diff --git a/libc/test/src/__support/wctype/CMakeLists.txt b/libc/test/src/__support/wctype/CMakeLists.txt index 17c98dc3d2770..988e71e45ae32 100644 --- a/libc/test/src/__support/wctype/CMakeLists.txt +++ b/libc/test/src/__support/wctype/CMakeLists.txt @@ -1,5 +1,21 @@ add_custom_target(libc-support-wctype-tests) +set(CONSTEXPR_FLAGS "") + +if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + if(CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC") + list(APPEND CONSTEXPR_FLAGS + -Xclang + -fconstexpr-steps=10000000) + else() + list(APPEND CONSTEXPR_FLAGS + -fconstexpr-steps=10000000) + endif() +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + list(APPEND CONSTEXPR_FLAGS + -fconstexpr-ops-limit=10000000) +endif() + add_libc_test( wctype_perfect_hash_test SUITE @@ -7,8 +23,7 @@ add_libc_test( SRCS wctype_perfect_hash_test.cpp COMPILE_OPTIONS - $<$:-Xclang -fconstexpr-steps=10000000> - $<$:-fconstexpr-ops-limit=10000000> + ${CONSTEXPR_FLAGS} DEPENDS libc.src.__support.wctype.lower_to_upper libc.src.__support.wctype.upper_to_lower