From 1ccbc209a4dbad1f7fd265f936402eeb4e2796de Mon Sep 17 00:00:00 2001 From: Hennadii Chernyshchyk Date: Tue, 13 Dec 2022 22:16:48 +0200 Subject: [PATCH] Add an option to disable Nullkiller AI --- AI/CMakeLists.txt | 12 ++++++++---- CMakeLists.txt | 1 - 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/AI/CMakeLists.txt b/AI/CMakeLists.txt index 6df381f50..9ed3f15eb 100644 --- a/AI/CMakeLists.txt +++ b/AI/CMakeLists.txt @@ -2,15 +2,19 @@ # FuzzyLite support # ####################################### +option(ENABLE_NULLKILLER_AI "Enable compilation of Nullkiller AI library" ON) if(NOT WIN32 AND NOT APPLE) option(FORCE_BUNDLED_FL "Force to use FuzzyLite included into VCMI's source tree" ON) else() option(FORCE_BUNDLED_FL "Force to use FuzzyLite included into VCMI's source tree" OFF) endif() -if(TBB_FOUND AND MSVC) - install_vcpkg_imported_tgt(TBB::tbb) -endif() +if(ENABLE_NULLKILLER_AI) + find_package(TBB REQUIRED) + if(MSVC) + install_vcpkg_imported_tgt(TBB::tbb) + endif() +end() if(NOT FORCE_BUNDLED_FL) @@ -40,6 +44,6 @@ add_subdirectory(BattleAI) add_subdirectory(StupidAI) add_subdirectory(EmptyAI) add_subdirectory(VCAI) -if(TBB_FOUND) +if(ENABLE_NULLKILLER_AI) add_subdirectory(Nullkiller) endif() diff --git a/CMakeLists.txt b/CMakeLists.txt index 457527bb4..67a150a86 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -312,7 +312,6 @@ find_package(SDL2_ttf REQUIRED) if(TARGET SDL2_ttf::SDL2_ttf) add_library(SDL2::TTF ALIAS SDL2_ttf::SDL2_ttf) endif() -find_package(TBB) if(ENABLE_LAUNCHER OR ENABLE_EDITOR) # Widgets finds its own dependencies (QtGui and QtCore).