Skip to content

fix: add missing include directory#338

Open
dragon-archer wants to merge 1 commit intoclice-io:mainfrom
dragon-archer:fix-cmake-include
Open

fix: add missing include directory#338
dragon-archer wants to merge 1 commit intoclice-io:mainfrom
dragon-archer:fix-cmake-include

Conversation

@dragon-archer
Copy link
Copy Markdown

@dragon-archer dragon-archer commented Jan 5, 2026

Without this patch, out-of-source building using CMake will generate following error:

E:\msys64\clang64\bin\c++.exe -DCLANG_BUILD_STATIC=1 -DSPDLOG_COMPILED_LIB -DSPDLOG_NO_EXCEPTIONS=1 -DSPDLOG_USE_STD_FORMAT=1 -IE:/Project/GitHub/clice/include -IE:/Project/GitHub/clice/build/generated -IE:/Project/GitHub/clice/build/_deps/libuv-src/include -IE:/Project/GitHub/clice/build/_deps/spdlog-src/include -IE:/Project/GitHub/clice/build/_deps/croaring-src/include -IE:/Project/GitHub/clice/build/_deps/croaring-src/cpp -IE:/Project/GitHub/clice/build/_deps/flatbuffers-src/include -isystem E:/Project/GitHub/clice/build/_deps/tomlplusplus-src/include -stdlib=libc++ -flto=thin -O3 -DNDEBUG -std=gnu++23 -fno-rtti -fno-exceptions -Wno-deprecated-declarations -Wno-undefined-inline -ffunction-sections -fdata-sections -MD -MT CMakeFiles/clice-core.dir/src/AST/Resolver.cpp.obj -MF CMakeFiles\clice-core.dir\src\AST\Resolver.cpp.obj.d -o CMakeFiles/clice-core.dir/src/AST/Resolver.cpp.obj -c E:/Project/GitHub/clice/src/AST/Resolver.cpp
E:/Project/GitHub/clice/src/AST/Resolver.cpp:7:10: fatal error: 'clang/Sema/TreeTransform.h' file not found
    7 | #include "clang/Sema/TreeTransform.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Summary by CodeRabbit

  • Chores
    • Updated build system configuration to expose additional include paths for the core library.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 5, 2026

📝 Walkthrough

Walkthrough

The change expands the public include directories for the clice-core CMake target by adding ${CMAKE_CURRENT_BINARY_DIR}/include to its public interface, allowing dependent targets to access generated headers from this additional binary directory path.

Changes

Cohort / File(s) Summary
CMake Build Configuration
CMakeLists.txt
Added ${CMAKE_CURRENT_BINARY_DIR}/include to the public target_include_directories for the clice-core target, exposing an additional binary-generated include path to dependents.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A path is born from binary ground,
Where headers hide, yet now are found,
One line of build, a simple way,
To light the dark and save the day! ✨

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: add missing include directory' directly describes the main change—adding a missing include directory to CMakeLists.txt—which aligns with the PR's objective of fixing out-of-source CMake builds.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dd8f0dd and f8466a4.

📒 Files selected for processing (1)
  • CMakeLists.txt
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: cmake / build (macos-15, Debug)
  • GitHub Check: cmake / build (windows-2025, RelWithDebInfo)
  • GitHub Check: cmake / build (ubuntu-24.04, Debug)
  • GitHub Check: clice / publish-clice (macos-15, clice.tar.gz, clice-arm64-macos-darwin.tar.gz, clice-symbol.tar.gz, clic...
  • GitHub Check: clice / publish-clice (windows-2025, clice.zip, clice-x64-windows-msvc.zip, clice-symbol.zip, clice-x64-w...
  • GitHub Check: clice / publish-clice (ubuntu-24.04, clice.tar.gz, clice-x86_64-linux-gnu.tar.gz, clice-symbol.tar.gz, cl...
🔇 Additional comments (1)
CMakeLists.txt (1)

166-170: No changes needed. The fix correctly handles private Clang headers for out-of-source builds.

The CMAKE_CURRENT_BINARY_DIR/include directory is properly populated by setup-llvm.py during CMake configuration. The script downloads private Clang headers (Sema/TreeTransform.h, Sema/TypeLocBuilder.h, Sema/CoroutineStmtBuilder.h) that aren't part of the public LLVM distribution and places them at CMAKE_CURRENT_BINARY_DIR/include/clang/. This complements the public headers provided via the llvm-libs target's INTERFACE include directories from LLVM_INSTALL_PATH/include. The PR correctly addresses the missing private header issue for out-of-source builds.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Joker-Principal
Copy link
Copy Markdown

headers_to_copy = ["CoroutineStmtBuilder.h", "TypeLocBuilder.h", "TreeTransform.h"]

These headers will be copied during building.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants