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