aboutsummaryrefslogtreecommitdiffstats
path: root/fpga_interchange/family.cmake
diff options
context:
space:
mode:
authorKeith Rothman <537074+litghost@users.noreply.github.com>2021-02-12 16:12:16 -0800
committerKeith Rothman <537074+litghost@users.noreply.github.com>2021-02-15 09:54:58 -0800
commit664407089b51e1c66d91ff1ee4aa4d4148bb8f1b (patch)
tree052acc1abc92bd87748b616e29ba7c396d38cae9 /fpga_interchange/family.cmake
parent5e11e29ba2e5927047b2dbf7d3b613dc33a9cc98 (diff)
downloadnextpnr-664407089b51e1c66d91ff1ee4aa4d4148bb8f1b.tar.gz
nextpnr-664407089b51e1c66d91ff1ee4aa4d4148bb8f1b.tar.bz2
nextpnr-664407089b51e1c66d91ff1ee4aa4d4148bb8f1b.zip
Add FPGA interchange frontend and backend.
Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
Diffstat (limited to 'fpga_interchange/family.cmake')
-rw-r--r--fpga_interchange/family.cmake22
1 files changed, 20 insertions, 2 deletions
diff --git a/fpga_interchange/family.cmake b/fpga_interchange/family.cmake
index c3fefaba..3f3b5a93 100644
--- a/fpga_interchange/family.cmake
+++ b/fpga_interchange/family.cmake
@@ -3,7 +3,25 @@ if(NOT ${TCL_FOUND})
message(FATAL_ERROR "Tcl is required for FPGA interchange Arch.")
endif()
+find_package(ZLIB REQUIRED)
+find_package(CapnProto REQUIRED)
+
+set(PROTOS LogicalNetlist.capnp PhysicalNetlist.capnp References.capnp)
+
+set(CAPNP_SRCS)
+set(CAPNP_HDRS)
+foreach (proto ${PROTOS})
+ capnp_generate_cpp(CAPNP_SRC CAPNP_HDR 3rdparty/fpga-interchange-schema/interchange/${proto})
+ list(APPEND CAPNP_HDRS ${CAPNP_HDR})
+ list(APPEND CAPNP_SRCS ${CAPNP_SRC})
+endforeach()
+add_library(fpga_interchange_capnp STATIC ${CAPNP_SRCS})
+
foreach (target ${family_targets})
- target_link_libraries(${target} LINK_PUBLIC ${TCL_LIBRARY})
- include_directories (${TCL_INCLUDE_PATH})
+ target_include_directories(${target} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/3rdparty/fpga-interchange-schema/interchange)
+ target_include_directories(${target} PRIVATE ${TCL_INCLUDE_PATH})
+ target_link_libraries(${target} PRIVATE ${TCL_LIBRARY})
+ target_link_libraries(${target} PRIVATE fpga_interchange_capnp)
+ target_link_libraries(${target} PRIVATE CapnProto::capnp)
+ target_link_libraries(${target} PRIVATE z)
endforeach()