Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cmake fails to configure with Xcode generator #121210

Open
SteveMontgomery opened this issue Dec 27, 2024 · 1 comment
Open

Cmake fails to configure with Xcode generator #121210

SteveMontgomery opened this issue Dec 27, 2024 · 1 comment
Labels
cmake Build system in general and CMake in particular

Comments

@SteveMontgomery
Copy link

I checked out the main branch. Cmake fails when configuring for the Xcode generator when clang is included in the project list. The same command with the Ninja generator works fine, i.e.

$ cmake --fresh -G "Xcode" -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_PROJECTS=clang ../llvm
fails

$ cmake --fresh -G "Xcode" -DCMAKE_BUILD_TYPE=Debug ../llvm
configures OK

$ cmake --fresh -G "Ninja" -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_PROJECTS=clang ../llvm
configures OK

When configuring for Xcode with clang enabled, there are multiple error messages of the form:
CMake Error at /Users/Steve/Development/llvm-project/clang/cmake/modules/AddClang.cmake:119 (target_compile_definitions):
Cannot specify compile definitions for target "obj.clangBasic" which is not
built by this project.
Call Stack (most recent call first):
/Users/Steve/Development/llvm-project/clang/lib/Basic/CMakeLists.txt:57 (add_clang_library)

I tracked this down to commit 09fa2f0 which certainly seems relevant given it's modified clang/cmake/modules/AddClang.cmake.

@SteveMontgomery
Copy link
Author

I should have said that I was using cmake 3.31.2, Xcode 16.2 (16C5032a) on macOS 15.2 (24C101).

@EugeneZelenko EugeneZelenko added cmake Build system in general and CMake in particular and removed new issue labels Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmake Build system in general and CMake in particular
Projects
None yet
Development

No branches or pull requests

2 participants