Skip to content

Commit

Permalink
cstool: fix cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
imbillow committed Jun 9, 2024
1 parent 7570795 commit 438f6cd
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
endif()

set(BUILD_RPATH_USE_ORIGIN true)
#set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address,undefined -fno-omit-frame-pointer -g -O3 -Wno-deprecated-declarations")

# Detect whether capstone is compiled as top-level or a subdirectory
set(PROJECT_IS_TOP_LEVEL OFF)
Expand Down Expand Up @@ -71,6 +70,13 @@ option(CAPSTONE_USE_ARCH_REGISTRATION "Use explicit architecture registration" O
option(CAPSTONE_ARCHITECTURE_DEFAULT "Whether architectures are enabled by default" ON)
option(CAPSTONE_DEBUG "Whether to enable extra debug assertions" OFF)
option(CAPSTONE_INSTALL "Generate install target" ${PROJECT_IS_TOP_LEVEL})
option(ENABLE_ASAN "Enable address sanitizer" OFF)

if (ENABLE_ASAN)
add_definitions(-DASAN_ENABLED)
add_compile_options(-fsanitize=address)
add_link_options(-fsanitize=address)
endif()

# If building for OSX it's best to allow CMake to handle building both architectures
if(APPLE AND NOT CAPSTONE_BUILD_MACOS_THIN)
Expand Down Expand Up @@ -893,9 +899,9 @@ if(CAPSTONE_BUILD_CSTEST)
GIT_REPOSITORY "https://git.cryptomilk.org/projects/cmocka.git"
GIT_TAG "origin/stable-1.1"
GIT_SHALLOW true
CONFIGURE_COMMAND cmake -DBUILD_SHARED_LIBS=ON ../cmocka_ext/
CONFIGURE_COMMAND cmake -DBUILD_SHARED_LIBS=OFF ../cmocka_ext/
BUILD_BYPRODUCTS ${CMOCKA_LIB_DIR}/libcmocka.a
BUILD_COMMAND cmake --build . --config Debug
BUILD_COMMAND cmake --build . --config Release
INSTALL_COMMAND ""
)
add_library(cmocka STATIC IMPORTED)
Expand Down

0 comments on commit 438f6cd

Please sign in to comment.