From 15ae22f7ccfc1401db133854023a5b259f8aae46 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Wed, 3 Mar 2021 23:29:37 +0100 Subject: [PATCH] Build: Add ENABLE_PCI_IDS_DOWNLOAD CMake option This allows disabling the download of the pci.ids database at build time. Addresses concerns raised in #5410. --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d969c02899f..1b5ce42c1fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,8 @@ option(ENABLE_MEMORY_SANITIZER "Enable memory sanitizer testing in gcc/clang" OF option(ENABLE_UNDEFINED_SANITIZER "Enable undefined behavior sanitizer testing in gcc/clang" OFF) option(ENABLE_FUZZER_SANITIZER "Enable fuzzer sanitizer testing in clang" OFF) option(ENABLE_ALL_THE_DEBUG_MACROS "Enable all debug macros to validate they still compile" OFF) -option(ENABLE_COMPILETIME_FORMAT_CHECK "Disable compiletime format string checks" ON) +option(ENABLE_COMPILETIME_FORMAT_CHECK "Enable compiletime format string checks" ON) +option(ENABLE_PCI_IDS_DOWNLOAD "Enable download of the pci.ids database at build time" ON) option(BUILD_LAGOM "Build parts of the system targeting the host OS for fuzzing/testing" OFF) add_custom_target(run @@ -185,7 +186,7 @@ add_subdirectory(Userland) set(PCI_IDS_URL https://pci-ids.ucw.cz/v2.2/pci.ids) set(PCI_IDS_PATH ${CMAKE_INSTALL_DATAROOTDIR}/pci.ids) -if(NOT EXISTS ${PCI_IDS_PATH}) +if(ENABLE_PCI_IDS_DOWNLOAD AND NOT EXISTS ${PCI_IDS_PATH}) message(STATUS "Downloading PCI ID database from ${PCI_IDS_URL}...") file(DOWNLOAD ${PCI_IDS_URL} ${PCI_IDS_PATH} INACTIVITY_TIMEOUT 10) endif()