Skip to content

clang llvm build error with -save-temps=obj #1240

@Chrys4lisfag

Description

@Chrys4lisfag

Description

Passing save temps for cpr target breaks the compilation
1:

CMake Error at cmake-build-relwithdebinfo-clang/_deps/cpr-src/include/CMakeLists.txt:95 (message):
  Your compiler does not support the `<filesystem>` include or cpr is unable
  to determine the proper compiler flags for it.
  1. Due to set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Werror")
    error: this style of line directive is a GNU extension [-Werror,-Wgnu-line-marker]

After crutching these two issues by forcing STD_FS_SUPPORTED and removing -Werror it compiled successfully

Example/How to Reproduce

set these flags:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -save-temps=obj -flto")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -save-temps=obj -flto")

issue repo:
https://github.com/Chrys4lisfag/cpr-llvm-issue

Possible Fix

No response

Where did you get it from?

GitHub (branch e.g. master)

Additional Context/Your Environment

  • OS: Windows
  • Version: master
  • clang-llvm 21

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions