From e12093201a97ee66ae6b0e751668c6169ff9a0f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miodrag=20Milanovi=C4=87?= Date: Thu, 23 Jan 2025 10:54:37 +0100 Subject: [PATCH] CMake: Add include guards when IMPORT_BBA_FILES is used (#1438) --- ecp5/CMakeLists.txt | 4 +++- gowin/CMakeLists.txt | 4 +++- himbaechel/uarch/gowin/CMakeLists.txt | 4 +++- ice40/CMakeLists.txt | 4 +++- machxo2/CMakeLists.txt | 7 ++++++- nexus/CMakeLists.txt | 4 +++- 6 files changed, 21 insertions(+), 6 deletions(-) diff --git a/ecp5/CMakeLists.txt b/ecp5/CMakeLists.txt index fdc51fbb..a71b89b2 100644 --- a/ecp5/CMakeLists.txt +++ b/ecp5/CMakeLists.txt @@ -1,4 +1,6 @@ -include(FindTrellis) +if (NOT IMPORT_BBA_FILES) + include(FindTrellis) +endif() set(SOURCES arch.cc diff --git a/gowin/CMakeLists.txt b/gowin/CMakeLists.txt index b09aa44e..80552ee0 100644 --- a/gowin/CMakeLists.txt +++ b/gowin/CMakeLists.txt @@ -1,4 +1,6 @@ -include(FindApycula) +if (NOT IMPORT_BBA_FILES) + include(FindApycula) +endif() set(SOURCES arch.cc diff --git a/himbaechel/uarch/gowin/CMakeLists.txt b/himbaechel/uarch/gowin/CMakeLists.txt index 1b60b115..9f536cc1 100644 --- a/himbaechel/uarch/gowin/CMakeLists.txt +++ b/himbaechel/uarch/gowin/CMakeLists.txt @@ -1,4 +1,6 @@ -include(FindApycula) +if (NOT IMPORT_BBA_FILES) + include(FindApycula) +endif() set(SOURCES constids.inc diff --git a/ice40/CMakeLists.txt b/ice40/CMakeLists.txt index 923fbffa..13dc83c0 100644 --- a/ice40/CMakeLists.txt +++ b/ice40/CMakeLists.txt @@ -1,4 +1,6 @@ -include(FindIceStorm) +if (NOT IMPORT_BBA_FILES) + include(FindIceStorm) +endif() set(SOURCES arch.cc diff --git a/machxo2/CMakeLists.txt b/machxo2/CMakeLists.txt index 57a470b2..5060c432 100644 --- a/machxo2/CMakeLists.txt +++ b/machxo2/CMakeLists.txt @@ -1,4 +1,6 @@ -include(FindTrellis) +if (NOT IMPORT_BBA_FILES) + include(FindTrellis) +endif() set(SOURCES arch.cc @@ -36,6 +38,9 @@ message(STATUS "Enabled MachXO2/XO3 devices: ${MACHXO2_DEVICES}") configure_file(machxo2_available.h.in ${CMAKE_CURRENT_BINARY_DIR}/machxo2_available.h) target_sources(nextpnr-${family}-core PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/machxo2_available.h) target_include_directories(nextpnr-${family}-core INTERFACE ${CMAKE_CURRENT_BINARY_DIR}) +if (BUILD_GUI) + target_include_directories(nextpnr-${family}-gui PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +endif() foreach (device ${MACHXO2_DEVICES}) if (NOT device IN_LIST ALL_MACHXO2_DEVICES) diff --git a/nexus/CMakeLists.txt b/nexus/CMakeLists.txt index bc0976fa..de57558f 100644 --- a/nexus/CMakeLists.txt +++ b/nexus/CMakeLists.txt @@ -1,4 +1,6 @@ -include(FindOxide) +if (NOT IMPORT_BBA_FILES) + include(FindOxide) +endif() set(SOURCES arch.cc