keystone
keystone copied to clipboard
Fixed LLVM_TARGETS_TO_BUILD in CMakeLists
Currently, it seems that it is not possible to compile Keystone by picking individual architectures For example, when using an external project, none of these work:
set(KEYSTONE_LLVM_TARGETS "AArch64;ARM;Mips;PowerPC;Sparc;SystemZ;X86")
set(KEYSTONE_CMAKE_ARGS ${KEYSTONE_CMAKE_ARGS} -DLLVM_TARGETS_TO_BUILD=${KEYSTONE_LLVM_TARGETS})
ExternalProject_Add(keystone-engine SOURCE_DIR ${KEYSTONE_DIR} INSTALL_COMMAND "" CMAKE_ARGS ${KEYSTONE_CMAKE_ARGS})
set(KEYSTONE_CMAKE_ARGS ${KEYSTONE_CMAKE_ARGS} -DLLVM_TARGETS_TO_BUILD="AArch64;ARM;Mips;PowerPC;Sparc;SystemZ;X86")
ExternalProject_Add(keystone-engine SOURCE_DIR ${KEYSTONE_DIR} INSTALL_COMMAND "" CMAKE_ARGS ${KEYSTONE_CMAKE_ARGS})
set(KEYSTONE_CMAKE_ARGS ${KEYSTONE_CMAKE_ARGS} -DLLVM_TARGETS_TO_BUILD=AArch64;ARM;Mips;PowerPC;Sparc;SystemZ;X86)
ExternalProject_Add(keystone-engine SOURCE_DIR ${KEYSTONE_DIR} INSTALL_COMMAND "" CMAKE_ARGS ${KEYSTONE_CMAKE_ARGS})
This PR fixes that by using space-separated targets in LLVM_TARGETS_TO_BUILD, and parsing with the CMake builtin command separate_arguments, available since at least CMake 3.0 (I didn't check earlier versions)