diff --git a/AI/CMakeLists.txt b/AI/CMakeLists.txt index 8e97d6aff..b396529d2 100644 --- a/AI/CMakeLists.txt +++ b/AI/CMakeLists.txt @@ -12,6 +12,10 @@ if(TBB_FOUND AND MSVC) install_vcpkg_imported_tgt(TBB::tbb) endif() +#FuzzyLite uses MSVC pragmas in headers, so, we need to disable -Wunknown-pragmas +if(MINGW) + add_compile_options(-Wno-unknown-pragmas) +endif() if(NOT FORCE_BUNDLED_FL) find_package(fuzzylite) @@ -27,6 +31,10 @@ if(NOT fuzzylite_FOUND) set(FL_BUILD_BINARY OFF CACHE BOOL "") set(FL_BUILD_SHARED OFF CACHE BOOL "") set(FL_BUILD_TESTS OFF CACHE BOOL "") + #It is for compiling FuzzyLite, it will not compile without it on GCC + if("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") + add_compile_options(-Wno-error=deprecated-declarations) + endif() add_subdirectory(FuzzyLite/fuzzylite EXCLUDE_FROM_ALL) add_library(fuzzylite::fuzzylite ALIAS fl-static) target_include_directories(fl-static PUBLIC ${CMAKE_HOME_DIRECTORY}/AI/FuzzyLite/fuzzylite)