[mlir][examples] Fix bugs in Standlone project's CMakeLists.txt #127716
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.
Fixes the following two issues from the Standalone project's
CMakeLists.txt:
LLVM_DEFINITIONS is formatted as string by
LLVMConfig.cmakein amanner which will cause unexpected results if the first definition
in is of the form
-Dkey=value. It must be preprocessed before passingit to
add_definitions, see the recommendation in the LLVM CMakedocumentation.
The
HandleLLVMOptionsscript resetsLLVM_DEFINITIONSto the definitionsassociated with the top-level source directory, so if the project is
top level, using
LLVM_DEFINITIONSafter invokingHandleLLVMOptionsis circular. Invoke
HandleLLVMOptionsonly if the project is top-leveland only after using
LLVM_DEFINITIONS.