From 42497c3ee6eba37ac9ca305a79dee8563d8865cf Mon Sep 17 00:00:00 2001 From: Ionel-Cristinel ANICHITEI Date: Tue, 30 Mar 2021 17:07:35 +0300 Subject: [PATCH] Allow users to disable disasmtool and isagenerator targets --- CMakeLists.txt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c38303..7bb642c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,8 @@ cmake_minimum_required(VERSION 3.12) +option(BDD_INCLUDE_TOOL "Include the disasmtool executable" ON) +option(BDD_INCLUDE_ISAGENERATOR "Include the isagenerator target (if a python interpreter is found)" ON) + set(BDD_VER_FILE ${CMAKE_CURRENT_LIST_DIR}/inc/version.h) file(STRINGS ${BDD_VER_FILE} disasm_ver_major REGEX "DISASM_VERSION_MAJOR") @@ -153,8 +156,8 @@ set_target_properties( add_library(bddisasm::bdshemu ALIAS bdshemu) -# If this is the master project (or if the user requested it) add disasmtool. -if ((${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}) OR BDD_INCLUDE_TOOL) +# If this is the master project (and if the user requested it) add disasmtool. +if ((${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}) AND BDD_INCLUDE_TOOL) if (WIN32) add_subdirectory(disasmtool) else () @@ -162,8 +165,8 @@ if ((${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}) OR BDD_INCLUDE_TOOL) endif () endif () -# If this is the master project (or if the user requested it) add isagenerator. -if ((${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}) OR BDD_INCLUDE_ISAGENERATOR) +# If this is the master project (and if the user requested it) add isagenerator. +if ((${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}) AND BDD_INCLUDE_ISAGENERATOR) add_subdirectory(isagenerator) endif ()