diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b95e41..bbf6d50 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,6 +47,23 @@ target_sources( cppfront/source/sema.h ) +# clang-cl: Clang on windows +if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")) + set(CLANG_CL 1) +endif() + +# Fix for debug builds on windows +# "fatal error C1128: number of sections exceeded object file format limit: compile with /bigobj" +target_compile_options( + cppfront_cppfront PRIVATE + # Visual C++ for windows + $<$:/bigobj> + # GCC for windows + $<$:-Wa,-mbig-obj> + # Clang for windows + $<$:-bigobj> +) + ## # Target definition for cpp2util runtime library