mirror of
https://github.com/fmtlib/fmt.git
synced 2026-07-30 16:26:27 +08:00
Merge 5ae4721b7e1b690e42b01227e22b76e33a3b2348 into 758d39eb239e6554d3ac0659b6f592fcd5317c24
This commit is contained in:
commit
c086c8dbca
7
.github/workflows/linux.yml
vendored
7
.github/workflows/linux.yml
vendored
@ -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:
|
||||
|
||||
@ -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…
x
Reference in New Issue
Block a user