Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,13 @@ jobs:
sudo apt install locales-all
cmake -E make_directory ${{runner.workspace}}/build

- name: Select matching C compiler
run: |
cc=${{matrix.cxx}}
cc=${cc/clang++/clang}
cc=${cc/g++/gcc}
echo "CC=$cc" >> "$GITHUB_ENV"

- name: Configure
working-directory: ${{runner.workspace}}/build
env:
Expand Down
14 changes: 11 additions & 3 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,14 @@ if (FMT_CUDA_TEST)
endif ()

enable_language(C)
add_executable(c-test c-test.c)
target_link_libraries(c-test PRIVATE fmt::fmt-c)
add_test(NAME c-test COMMAND c-test)
# Clang < 3.8 doesn't apply array-to-pointer decay to the controlling
# expression of _Generic (https://llvm.org/PR16340), so fmt-c.h's argument
# dispatch doesn't match string literals there.
if (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION
VERSION_LESS 3.8)
message(STATUS "Skipping c-test: _Generic is broken in Clang < 3.8")
else ()
add_executable(c-test c-test.c)
target_link_libraries(c-test PRIVATE fmt::fmt-c)
add_test(NAME c-test COMMAND c-test)
endif ()
Loading