How can I add a compile definition to a subdirectory?
xtremegamer1 opened this issue · 2 comments
xtremegamer1 commented
I imagine it should look something like this:
[subdir.asmjit]
compile_definitions = [
"ASMJIT_STATIC"
]
gmh5225 commented
Maybe you could try it this way
[subdir.asmjit]
include-before = ["asmjit-static.cmake"]
In asmjit-static.cmake:
add_definitions(-DASMJIT_STATIC)
mrexodia commented
Yeah you can do this, but it’s not the correct way to do this. Asmjit has a CMake option
to build statically and you should set that instead:
[subdir.asmjit]
cmake-before = "set(ASMJIT_STATIC ON)"
The DEFINED
keyword in CMake (confusingly) has nothing to do with compile definitions and instead checks if a CMake variable is defined.