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 abd8c7506c
commit ceb546e1da

View File

@ -12,6 +12,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)
option(CAPSTONE_ARM_SUPPORT "ARM support" ON)
@ -412,7 +413,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})