-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Note: for general questions and comments, please use the forums at:
https://groups.google.com/g/json-c
Describe the bug
Building with clang-cl currently fails due to CMake not distinguishing it from clang with the GNU-style CLI.
clang-cl.exe /nologo -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_GNU_SOURCE -D_UNICODE -IC:\Users\Erin\.conan2\p\b\json-e2cfe01b7c40f\b\src -IC:\Users\Erin\.conan2\p\b\json-e2cfe01b7c40f\b\build\Debug /EHsc /permissive- /Zc:preprocessor /volatile:iso -Wno-unused-command-line-argument -fuse-ld=lld /DWIN32 /D_WINDOWS /W3 -ffunction-sections -fdata-sections -Werror -Wall -Wcast-qual -Wno-error=deprecated-declarations -Wextra -Wwrite-strings -Wno-unused-parameter /Zi /Ob0 /Od /RTC1 -MDd /showIncludes /FoCMakeFiles\json-c.dir\json_util.c.obj /FdCMakeFiles\json-c.dir\json-c.pdb -c -- C:\Users\Erin\.conan2\p\b\json-e2cfe01b7c40f\b\src\json_util.c
clang-cl: error: unknown argument ignored in clang-cl: '-ffunction-sections' [-Werror,-Wunknown-argument]
clang-cl: error: unknown argument ignored in clang-cl: '-fdata-sections' [-Werror,-Wunknown-argument]
The proper fix is using CMAKE_C_COMPILER_FRONTEND_VARIANT, but it would require bumping the CMake version to 3.14.
I know about the DISABLE_WERROR
option, but clang-cl
needs to be detected as MSVC.
Steps To Reproduce
- Configure CMake with
CMAKE_C_COMPILER
set toclang-cl
- Build
Version and Platform
- json-c version: >= 0.16
- OS: Any
- Custom cmake/build flags, if any: None that would be relevant
Metadata
Metadata
Assignees
Labels
No labels