Skip to content

Commit

Permalink
add flag for clang-cl only
Browse files Browse the repository at this point in the history
  • Loading branch information
sjsprecious committed Jan 31, 2025
1 parent e06aa7b commit 337fed5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Run CMake
run: cmake -S . -B build -G "Visual Studio 16 2019" -A ${{ matrix.architecture }} -T ClangCL
run: cmake -S . -B build -D CMAKE_CXX_COMPILER="C:/Program Files/LLVM/bin/clang-cl.exe" -G "Visual Studio 16 2019" -A ${{ matrix.architecture }} -T ClangCL
- name: Build
run: cmake --build build --config Debug --parallel 10
- name: Test
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ if (${CMAKE_HOST_SYSTEM_NAME} MATCHES "Linux" AND "${CMAKE_CXX_COMPILER_ID}" STR
endif()

# on Windows with MSVC, add the /bigobj flag to allow for large object files
if (${CMAKE_HOST_SYSTEM_NAME} MATCHES "Windows" AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"))
if (${CMAKE_HOST_SYSTEM_NAME} MATCHES "Windows" AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR "${CMAKE_CXX_COMPILER}" STREQUAL "clang-cl"))
# If the compiler is MSVC or Clang on Windows, use /bigobj
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
message(STATUS "Added /bigobj flag to CMAKE_CXX_FLAGS")
endif()

################################################################################
Expand Down

0 comments on commit 337fed5

Please sign in to comment.