CMakeLists.txt: Add cstool build option (#1118)

This commit is contained in:
Connor Davis 2018-04-25 20:15:59 -06:00 committed by Nguyen Anh Quynh
parent 1da2ae94de
commit b377747e8e

View File

@ -25,6 +25,7 @@ option(CAPSTONE_BUILD_STATIC "Build static library" ON)
option(CAPSTONE_BUILD_SHARED "Build shared library" ON)
option(CAPSTONE_BUILD_DIET "Build diet library" OFF)
option(CAPSTONE_BUILD_TESTS "Build tests" ON)
option(CAPSTONE_BUILD_CSTOOL "Build cstool" ON)
option(CAPSTONE_USE_DEFAULT_ALLOC "Use default memory allocation functions" ON)
set(SUPPORTED_ARCHITECTURES ARM ARM64 M68K MIPS PPC SPARC SYSZ XCORE X86 TMS320C64X M680X EVM)
@ -539,7 +540,7 @@ if (CAPSTONE_BUILD_SHARED)
ARCHIVE DESTINATION ${INSTALL_LIB_DIR})
endif ()
if (CAPSTONE_BUILD_SHARED)
if (CAPSTONE_BUILD_SHARED AND CAPSTONE_BUILD_CSTOOL)
FILE(GLOB CSTOOL_SRC cstool/*.c)
add_executable(cstool ${CSTOOL_SRC})
target_link_libraries(cstool ${default-target})