@@ -44,13 +44,17 @@ FetchContent_Declare(
4444)
4545
4646FetchContent_Declare (
47- capstone
47+ capstone-lib
4848 GIT_REPOSITORY https://github.com/UoB-HPC/capstone.git
49- GIT_TAG e7be7d99e718ef9741026b80fc6f5e100fdf4f94 # trunk
49+ GIT_TAG Armv9.2-update
50+ GIT_PROGRESS TRUE
51+
52+ # Old Git tag pre-Armv9.2
53+ # GIT_TAG e7be7d99e718ef9741026b80fc6f5e100fdf4f94 # trunk
5054)
5155
5256cmake_policy (SET CMP0048 NEW )
53- project (SimEng VERSION 0.9.3 LANGUAGES C CXX )
57+ project (SimEng VERSION 0.9.4 LANGUAGES C CXX )
5458
5559# If no build type was defined, default to Release
5660if (NOT CMAKE_BUILD_TYPE )
@@ -87,6 +91,7 @@ install(DIRECTORY src/include/simeng
8791set (CAPSTONE_BUILD_TESTS OFF CACHE BOOL "Disable Capstone tests" )
8892set (CAPSTONE_BUILD_SHARED OFF CACHE BOOL "Disable Capstone shared library" )
8993set (CAPSTONE_BUILD_CSTOOL OFF CACHE BOOL "Disable cstool build" )
94+ set (CAPSTONE_INSTALL OFF CACHE BOOL "Disable install of capstone" )
9095
9196set (CAPSTONE_ARM_SUPPORT OFF CACHE BOOL "Disable A32 support" )
9297set (CAPSTONE_MIPS_SUPPORT OFF CACHE BOOL "Disable MIPS support" )
@@ -104,7 +109,7 @@ set(CAPSTONE_WASM_SUPPORT OFF CACHE BOOL "Disable WASM support")
104109set (CAPSTONE_BPF_SUPPORT OFF CACHE BOOL "Disable BPF support" )
105110set (CAPSTONE_RISCV_SUPPORT OFF CACHE BOOL "Disable RISCV support" )
106111
107- FetchContent_MakeAvailable_Args (capstone EXCLUDE_FROM_ALL )
112+ FetchContent_MakeAvailable_Args (capstone-lib EXCLUDE_FROM_ALL )
108113include_directories ("${capstone_BINARY_DIR } /include" "${capstone_SOURCE_DIR } /include" )
109114
110115## Setup yaml-cpp ##
@@ -118,7 +123,7 @@ option(SIMENG_USE_EXTERNAL_LLVM "Use an external LLVM rather than building it as
118123option (SIMENG_SANITIZE "Enable compiler sanitizers" OFF )
119124option (SIMENG_OPTIMIZE "Enable Extra Compiler Optimizatoins" OFF )
120125
121- if (SIMENG_OPTIMIZE)
126+ if (SIMENG_OPTIMIZE)
122127 # Turn on link time optimization for all targets.
123128 set (CMAKE_INTERPROCEDURAL_OPTIMIZATION ON )
124129
@@ -177,12 +182,17 @@ if(SIMENG_ENABLE_TESTS)
177182 # make sure we get the headers too
178183 include_directories ("${llvm_BINARY_DIR } /include" "${llvm_SOURCE_DIR } /include" )
179184
180- find_package (LLVM REQUIRED CONFIG NO_DEFAULT_PATH
185+ find_package (LLVM REQUIRED CONFIG NO_DEFAULT_PATH
181186 PATHS "${llvm_BINARY_DIR } /lib/cmake/llvm" )
182-
187+
183188 # NOTE: we don't do the usual version checks here because it needs vars exported in find_LLVM
184189 # we just assume it's good beacuse it must be whitelisted in FetchContent_Declare
185-
190+
191+ endif ()
192+
193+ # Check LLVM version
194+ if ((${LLVM_PACKAGE_VERSION} VERSION_LESS "9.0" ) OR (${LLVM_PACKAGE_VERSION} VERSION_GREATER_EQUAL "13.0" ))
195+ message (FATAL_ERROR "LLVM version must be >= 9.0 and < 13.0" )
186196 endif ()
187197
188198 set (SIMENG_LLVM_VERSION ${LLVM_VERSION_MAJOR} CACHE INTERNAL "LLVM major version number used." )
0 commit comments