Fix for building with clang/msvc2022 (/bigjob)

clang++.exe doesn't understand the `/bigjob` flag.
So use generator expression to only pass the flag with MSVC and pass the
correct flag with other compiler (I did mingw as well just in case)

Fixes #8981
This commit is contained in:
Olivier Goffart 2025-07-28 11:30:27 +02:00
parent 652fab4cbc
commit 90d46dfb56

View file

@ -184,8 +184,12 @@ if (SLINT_BUILD_RUNTIME)
add_library(Slint::Slint ALIAS Slint)
target_link_libraries(Slint INTERFACE slint_cpp)
target_compile_features(Slint INTERFACE cxx_std_20)
if (MSVC)
target_compile_options(Slint INTERFACE /bigobj)
if (WIN32)
target_compile_options(Slint INTERFACE
$<$<CXX_COMPILER_ID:MSVC>:/bigobj>
$<$<CXX_COMPILER_ID:Clang>:-Wa,-mbig-obj>
$<$<CXX_COMPILER_ID:GNU>:-Wa,-mbig-obj>
)
endif()
foreach(feature ${public_cmake_features})