From cf9c74575b27a87d9c3ee70cfa3fb902818695ee Mon Sep 17 00:00:00 2001 From: Catherine Date: Wed, 29 Jan 2025 04:27:10 +0000 Subject: [PATCH] CMake: exclude *-bba and *-chipdb targets from `make all`. Due to the way CMake-generated Makefiles evaluate dependencies, this calls the `.bba` generation custom command twice, which then fails as they both use the same `.bba.new` file as an output and one of them moves it first. This broke builds using `make -j` but not builds using `make -j nextpnr-himbaechel-example`. --- CMakeLists.txt | 6 +++--- himbaechel/CMakeLists.txt | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c3561e3c..0676eb30 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -241,7 +241,7 @@ add_subdirectory(rust) add_subdirectory(tests/gui) -add_custom_target(nextpnr-all-bba) +add_custom_target(nextpnr-all-bba EXCLUDE_FROM_ALL) function(add_nextpnr_architecture target) cmake_parse_arguments(arg "" "MAIN_SOURCE" "CORE_SOURCES;TEST_SOURCES;CURRENT_SOURCE_DIR;CURRENT_BINARY_DIR" ${ARGN}) @@ -331,11 +331,11 @@ function(add_nextpnr_architecture target) # Chip database - add_library(nextpnr-${target}-bba INTERFACE) + add_library(nextpnr-${target}-bba INTERFACE EXCLUDE_FROM_ALL) add_dependencies(nextpnr-all-bba nextpnr-${target}-bba) - add_library(nextpnr-${target}-chipdb INTERFACE) + add_library(nextpnr-${target}-chipdb INTERFACE EXCLUDE_FROM_ALL) target_link_libraries(nextpnr-${target}-core INTERFACE nextpnr-${target}-chipdb) diff --git a/himbaechel/CMakeLists.txt b/himbaechel/CMakeLists.txt index f5c1fa96..06430c37 100644 --- a/himbaechel/CMakeLists.txt +++ b/himbaechel/CMakeLists.txt @@ -49,11 +49,11 @@ else() target_sources(nextpnr-himbaechel-core INTERFACE ${arg_CORE_SOURCES}) - add_library(nextpnr-himbaechel-${microtarget}-bba INTERFACE) + add_library(nextpnr-himbaechel-${microtarget}-bba INTERFACE EXCLUDE_FROM_ALL) add_dependencies(nextpnr-himbaechel-bba nextpnr-himbaechel-${microtarget}-bba) - add_library(nextpnr-himbaechel-${microtarget}-chipdb INTERFACE) + add_library(nextpnr-himbaechel-${microtarget}-chipdb INTERFACE EXCLUDE_FROM_ALL) target_link_libraries(nextpnr-himbaechel-core INTERFACE nextpnr-himbaechel-${microtarget}-chipdb)