File tree Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,27 @@ capnp_generate_cpp(CAPNP_SRCS CAPNP_HDRS
34
34
if (VPR_ENABLE_INTERCHANGE )
35
35
set (IC_DIR ${CMAKE_SOURCE_DIR} /libs/EXTERNAL/libinterchange/interchange )
36
36
set (CAPNPC_SRC_PREFIX ${IC_DIR} )
37
+
38
+ find_program (WGET wget REQUIRED )
39
+
40
+ # Add Java schema
41
+ set (JAVA_SCHEMA ${CMAKE_CURRENT_BINARY_DIR} /schema/capnp/java.capnp )
42
+ add_custom_command (
43
+ OUTPUT ${JAVA_SCHEMA}
44
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR} /schema/capnp/
45
+ COMMAND ${WGET}
46
+ https://raw.githubusercontent.com/capnproto/capnproto-java/master/compiler/src/main/schema/capnp/java.capnp
47
+ -O ${JAVA_SCHEMA}
48
+ )
49
+
50
+ add_custom_target (
51
+ get_java_capnp_schema
52
+ DEPENDS ${JAVA_SCHEMA}
53
+ )
54
+
55
+ set (CAPNPC_IMPORT_DIRS )
56
+ list (APPEND CAPNPC_IMPORT_DIRS ${CMAKE_CURRENT_BINARY_DIR} /schema )
57
+
37
58
set (IC_PROTOS
38
59
LogicalNetlist.capnp
39
60
PhysicalNetlist.capnp
@@ -50,8 +71,8 @@ if (VPR_ENABLE_INTERCHANGE)
50
71
)
51
72
list (APPEND IC_SRCS ${IC_SRC} )
52
73
list (APPEND IC_HDRS ${IC_HDR} )
74
+ list (APPEND CAPNP_DEFS ${IC_DIR} /${PROTO} )
53
75
endforeach ()
54
-
55
76
endif ()
56
77
57
78
install (FILES ${CAPNP_DEFS} DESTINATION ${CMAKE_INSTALL_DATADIR} /vtr )
@@ -64,6 +85,13 @@ add_library(libvtrcapnproto STATIC
64
85
serdes_utils.h
65
86
serdes_utils.cpp
66
87
)
88
+
89
+ if (VPR_ENABLE_INTERCHANGE )
90
+ add_dependencies (libvtrcapnproto
91
+ get_java_capnp_schema
92
+ )
93
+ endif ()
94
+
67
95
target_include_directories (libvtrcapnproto PUBLIC
68
96
${CMAKE_CURRENT_SOURCE_DIR}
69
97
${CMAKE_CURRENT_BINARY_DIR}
You can’t perform that action at this time.
0 commit comments