Skip to content

Commit

Permalink
enable CI for Clang
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielaE committed Apr 24, 2023
1 parent 122caa0 commit 57f27d8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ jobs:
shell: msys2 {0}
strategy:
matrix:
sys: [ ucrt64 ]
cxx: [ clang++ ]
lib: [ libc++, libstdc++ ]
steps:
- name: Set timezone
run: tzutil /s "Ekaterinburg Standard Time"
Expand All @@ -68,10 +69,16 @@ jobs:
with:
release: false
msystem: ucrt64
pacboy: cc:u cmake:u ninja:u lld:u clang:u
pacboy: cmake:u ninja:u clang:u libc++:u gcc-libs:u
- name: Configure
run: cmake -B ../build -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Debug
env: { LDFLAGS: -fuse-ld=lld }
run: |
cmake -B ../build -G "Ninja" -DCMAKE_CXX_VERSION=20 \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Debug
env:
CXX: ${{matrix.cxx}}
CXXFLAGS: ${{format('-stdlib={0}', matrix.lib)}}

- name: Build
run: cmake --build ../build
- name: Test
Expand Down
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ function(enable_module target)
target_compile_options(${target}
PRIVATE /interface /dxifcInlineFunctions-
INTERFACE /reference fmt=${BMI})
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(BMI ${CMAKE_CURRENT_BINARY_DIR}/fmt.pcm)
target_compile_options(${target}
PRIVATE -fmodule-output=${BMI} -x c++-module
INTERFACE -fmodule-file=fmt=${BMI})
endif ()
set_target_properties(${target} PROPERTIES ADDITIONAL_CLEAN_FILES ${BMI})
set_source_files_properties(${BMI} PROPERTIES GENERATED ON)
Expand Down Expand Up @@ -88,7 +93,10 @@ option(FMT_MODULE "Build a module instead of a traditional library." OFF)
option(FMT_SYSTEM_HEADERS "Expose headers with marking them as system." OFF)

set(FMT_CAN_MODULE OFF)
if (CMAKE_CXX_STANDARD GREATER 17 AND MSVC AND MSVC_VERSION GREATER 1933)
if (CMAKE_CXX_STANDARD GREATER 17 AND (
(MSVC AND MSVC_VERSION GREATER 1933) OR
((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND
(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "16.0"))))
set(FMT_CAN_MODULE ON)
endif ()
if (NOT FMT_CAN_MODULE)
Expand Down

0 comments on commit 57f27d8

Please sign in to comment.