aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorKeith Rothman <537074+litghost@users.noreply.github.com>2021-03-18 13:47:06 -0700
committerKeith Rothman <537074+litghost@users.noreply.github.com>2021-03-18 14:00:19 -0700
commitf4dc67879e965249191d4b6f9e43d5647c39921a (patch)
treecca5260ba473c0632299dfb6f33fc12f316b2ae4 /CMakeLists.txt
parentb8678e778ed4dde0c477a93156c3fd39dffc517f (diff)
downloadnextpnr-f4dc67879e965249191d4b6f9e43d5647c39921a.tar.gz
nextpnr-f4dc67879e965249191d4b6f9e43d5647c39921a.tar.bz2
nextpnr-f4dc67879e965249191d4b6f9e43d5647c39921a.zip
Fixup GUI link dependencies on headers from libraries.
Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt16
1 files changed, 12 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6ebc2e75..daddb258 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,9 @@
cmake_minimum_required(VERSION 3.5)
project(nextpnr CXX C)
+# Allow family.cmake add additional dependencies to gui_${family}.
+cmake_policy(SET CMP0079 NEW)
+
option(BUILD_GUI "Build GUI" OFF)
option(BUILD_PYTHON "Build Python Integration" ON)
option(BUILD_TESTS "Build tests" OFF)
@@ -223,6 +226,12 @@ else()
set(BBASM_ENDIAN_FLAG "--le")
endif()
+set(EXTRA_LIB_DEPS)
+if (USE_THREADS)
+ list(APPEND EXTRA_LIB_DEPS absl::flat_hash_map)
+ list(APPEND EXTRA_LIB_DEPS absl::flat_hash_set)
+endif()
+
foreach (family ${ARCH})
message(STATUS "Configuring architecture: ${family}")
string(TOUPPER ${family} ufamily)
@@ -276,10 +285,9 @@ foreach (family ${ARCH})
# Include the family-specific CMakeFile
include(${family}/family.cmake)
foreach (target ${family_targets})
- if (USE_THREADS)
- target_link_libraries(${target} PRIVATE absl::flat_hash_map)
- target_link_libraries(${target} PRIVATE absl::flat_hash_set)
- endif()
+ foreach(lib_dep ${EXTRA_LIB_DEPS})
+ target_link_libraries(${target} PRIVATE ${lib_dep})
+ endforeach()
# Include family-specific source files to all family targets and set defines appropriately
target_include_directories(${target} PRIVATE ${family}/ ${CMAKE_CURRENT_BINARY_DIR}/generated/)