Open gmh5225 opened 2 years ago
add_definition is bad practice and I don’t want to generate that. Could you show an example of where compile-definitions doesn’t work, maybe something needs to be fixed there instead.
add_definition is bad practice and I don’t want to generate that. Could you show an example of where compile-definitions doesn’t work, maybe something needs to be fixed there instead.
You can use this project as a test. It mainly refers to the LLVM macro definitions
compile-definitions = ["${LLVM_DEFINITIONS}", "${CLANG_DEFINITIONS}"]
And then Visual Studio's Intellisense will report an error.
But
add_definitions(${LLVM_DEFINITIONS})
add_definitions(${CLANG_DEFINITIONS})
is ok.
The reason is that you are adding a single flag and not multiple. Using variables isn’t really supported in this way with cmkr, but I’ll give it a try later.
Instead I recommend using: https://github.com/LLVMParty/LLVMCMakeTemplate/blob/master/cmake/LLVM.cmake
You can use include-after and then link to the LLVM-Wrapper target.
Wow. I see. This project looks good. Thank you.
Would like to add an add-definitions option. Sometimes compile-definitions doesn't work so well.