fix(cmake): remove redundant add_definitions(${LLVM_DEFINITIONS})#3021
Merged
fifield merged 4 commits intoXilinx:mainfrom Apr 21, 2026
Merged
fix(cmake): remove redundant add_definitions(${LLVM_DEFINITIONS})#3021fifield merged 4 commits intoXilinx:mainfrom
fifield merged 4 commits intoXilinx:mainfrom
Conversation
HandleLLVMOptions already adds all LLVM compile definitions individually
via add_compile_definitions(). The add_definitions(${LLVM_DEFINITIONS})
calls were redundant and caused garbled -D flags with GCC because
LLVM_DEFINITIONS is a space-separated string, not a CMake list.
Fixes Xilinx#2965.
Generated using Claude Code.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes redundant add_definitions(${LLVM_DEFINITIONS}) calls from CMake subprojects that already include(HandleLLVMOptions), avoiding duplicated/garbled -D definitions that break GCC builds (issue #2965).
Changes:
- Removed
add_definitions(${LLVM_DEFINITIONS})from sixCMakeLists.txtfiles that already includeHandleLLVMOptions. - Ensures LLVM compile definitions are applied only via LLVM’s CMake machinery, preventing malformed preprocessor definitions with GCC.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| CMakeLists.txt | Drops redundant LLVM compile definitions in the top-level build configuration. |
| test/CMakeLists.txt | Drops redundant LLVM compile definitions for test configuration (affects CppTests build). |
| utils/mlir_aie_wheels/python_bindings/CMakeLists.txt | Drops redundant LLVM compile definitions for wheel/python bindings build. |
| programming_guide/CMakeLists.txt | Drops redundant LLVM compile definitions for programming guide build/tests. |
| programming_examples/CMakeLists.txt | Drops redundant LLVM compile definitions for examples build/tests. |
| mlir_exercises/CMakeLists.txt | Drops redundant LLVM compile definitions for exercises build/tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jgmelber
approved these changes
Apr 14, 2026
Contributor
Author
|
CI checks out,but the queue bot kicked it out on Apr 14. Still seems okay, though. Anything else to take care of before merge? |
joeldushouyu
pushed a commit
to joeldushouyu/mlir-aie
that referenced
this pull request
Apr 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
add_definitions(${LLVM_DEFINITIONS})from all six CMakeLists.txt files that alsoinclude(HandleLLVMOptions)HandleLLVMOptionsalready adds every flag individually viaadd_compile_definitions(), making these calls purely duplicative-Dflags with GCC becauseLLVM_DEFINITIONSis a space-separated string, not a CMake listFixes #2965.
Test plan
target_model,target_model_rtti, andregister_databaseCppTests build and pass with Clang after removalGenerated using Claude Code.