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

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 625e880..be5060f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,6 +12,7 @@
 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 @@
             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})