Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed LLVM_TARGETS_TO_BUILD in CMakeLists #582

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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