Skip to content

Conversation

@rdbo
Copy link

@rdbo rdbo commented May 29, 2024

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant