File tree 13 files changed +27
-4
lines changed
13 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -41,10 +41,16 @@ endfunction()
41
41
42
42
# This function is used by add_module
43
43
function (module_generate_y_from_ym FileWoExtSrc FileWoExtDst)
44
- if (${ARGC} EQUAL 2)
44
+ if (${ARGC} EQUAL 2 OR ${ARGC} EQUAL 3)
45
+ set (DEPS ${PROJECT_SOURCE_DIR} /lib/cfg-grammar.y)
46
+
47
+ if (${ARGC} EQUAL 3)
48
+ set (DEPS ${DEPS} ${ARGV2} )
49
+ endif ()
50
+
45
51
add_custom_command (OUTPUT ${FileWoExtDst} .y
46
52
COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR} /lib/merge-grammar.py ${FileWoExtSrc} .ym > ${FileWoExtDst} .y
47
- DEPENDS ${PROJECT_SOURCE_DIR} /lib/cfg-grammar.y
53
+ DEPENDS ${DEPS}
48
54
${FileWoExtSrc} .ym)
49
55
else ()
50
56
message (SEND_ERROR "Wrong usage of module_generate_y_from_ym() function" )
Original file line number Diff line number Diff line change @@ -26,10 +26,10 @@ include(CMakeParseArguments)
26
26
27
27
function (add_module)
28
28
29
- cmake_parse_arguments (ADD_MODULE "" "TARGET" "GRAMMAR;SOURCES;DEPENDS;INCLUDES;LIBRARY_TYPE;COMPILE_OPTIONS" ${ARGN} )
29
+ cmake_parse_arguments (ADD_MODULE "" "TARGET" "GRAMMAR;GRAMMAR_DEPENDS; SOURCES;DEPENDS;INCLUDES;LIBRARY_TYPE;COMPILE_OPTIONS" ${ARGN} )
30
30
31
31
if (ADD_MODULE_GRAMMAR)
32
- module_generate_y_from_ym(${CMAKE_CURRENT_SOURCE_DIR} /${ADD_MODULE_GRAMMAR} ${CMAKE_CURRENT_BINARY_DIR} /${ADD_MODULE_GRAMMAR} )
32
+ module_generate_y_from_ym(${CMAKE_CURRENT_SOURCE_DIR} /${ADD_MODULE_GRAMMAR} ${CMAKE_CURRENT_BINARY_DIR} /${ADD_MODULE_GRAMMAR} ${ADD_MODULE_GRAMMAR_DEPENDS} )
33
33
bison_target(${ADD_MODULE_TARGET} Grammar}
34
34
${CMAKE_CURRENT_BINARY_DIR} /${ADD_MODULE_GRAMMAR} .y
35
35
${CMAKE_CURRENT_BINARY_DIR} /${ADD_MODULE_GRAMMAR} .c
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ add_module(
28
28
add_module(
29
29
TARGET bigquery
30
30
GRAMMAR bigquery-grammar
31
+ GRAMMAR_DEPENDS ${GRPC_COMMON_GRAMMAR}
31
32
DEPENDS bigquery-cpp grpc-common-cpp
32
33
INCLUDES ${PROJECT_SOURCE_DIR} /modules/grpc
33
34
SOURCES ${BIGQUERY_SOURCES}
Original file line number Diff line number Diff line change 59
59
modules/grpc/bigquery modules/grpc/bigquery/ mod-bigquery :
60
60
endif
61
61
62
+ modules/grpc/bigquery/bigquery-grammar.y : modules/grpc/common/grpc-grammar.ym
63
+
62
64
BUILT_SOURCES += \
63
65
modules/grpc/bigquery/bigquery-grammar.y \
64
66
modules/grpc/bigquery/bigquery-grammar.c \
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ add_module(
28
28
add_module(
29
29
TARGET clickhouse
30
30
GRAMMAR clickhouse-grammar
31
+ GRAMMAR_DEPENDS ${GRPC_COMMON_GRAMMAR}
31
32
DEPENDS clickhouse-cpp grpc-common-cpp
32
33
INCLUDES ${PROJECT_SOURCE_DIR} /modules/grpc
33
34
SOURCES ${CLICKHOUSE_SOURCES}
Original file line number Diff line number Diff line change 59
59
modules/grpc/clickhouse modules/grpc/clickhouse/ mod-clickhouse :
60
60
endif
61
61
62
+ modules/grpc/clickhouse/clickhouse-grammar.y : modules/grpc/common/grpc-grammar.ym
63
+
62
64
BUILT_SOURCES += \
63
65
modules/grpc/clickhouse/clickhouse-grammar.y \
64
66
modules/grpc/clickhouse/clickhouse-grammar.c \
Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ set(GRPC_COMMON_CPP_SOURCES
18
18
grpc-source -worker.hpp
19
19
grpc-source -worker.cpp)
20
20
21
+ set (GRPC_COMMON_GRAMMAR ${PROJECT_SOURCE_DIR} /modules/grpc/common/grpc-grammar.ym PARENT_SCOPE)
22
+
21
23
add_module(
22
24
TARGET grpc-common-cpp
23
25
SOURCES ${GRPC_COMMON_CPP_SOURCES}
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ add_module(
29
29
add_module(
30
30
TARGET loki
31
31
GRAMMAR loki-grammar
32
+ GRAMMAR_DEPENDS ${GRPC_COMMON_GRAMMAR}
32
33
DEPENDS loki-cpp grpc-common-cpp
33
34
INCLUDES ${PROJECT_SOURCE_DIR} /modules/grpc
34
35
SOURCES ${LOKI_SOURCES}
Original file line number Diff line number Diff line change 59
59
modules/grpc/loki modules/grpc/loki/ mod-loki :
60
60
endif
61
61
62
+ modules/grpc/loki/loki-grammar.y : modules/grpc/common/grpc-grammar.ym
63
+
62
64
BUILT_SOURCES += \
63
65
modules/grpc/loki/loki-grammar.y \
64
66
modules/grpc/loki/loki-grammar.c \
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ add_module(
44
44
add_module(
45
45
TARGET otel
46
46
GRAMMAR otel-grammar
47
+ GRAMMAR_DEPENDS ${GRPC_COMMON_GRAMMAR}
47
48
DEPENDS otel-cpp grpc-common-cpp
48
49
INCLUDES ${PROJECT_SOURCE_DIR} /modules/grpc
49
50
SOURCES ${OTEL_SOURCES}
Original file line number Diff line number Diff line change 79
79
modules/grpc/otel modules/grpc/otel/ mod-otel :
80
80
endif
81
81
82
+ modules/grpc/otel/otel-grammar.y : modules/grpc/common/grpc-grammar.ym
83
+
82
84
BUILT_SOURCES += \
83
85
modules/grpc/otel/otel-grammar.y \
84
86
modules/grpc/otel/otel-grammar.c \
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ add_module(
29
29
TARGET pubsub
30
30
GRAMMAR pubsub-grammar
31
31
DEPENDS pubsub-cpp grpc-common-cpp
32
+ GRAMMAR_DEPENDS ${GRPC_COMMON_GRAMMAR}
32
33
INCLUDES ${PROJECT_SOURCE_DIR} /modules/grpc
33
34
SOURCES ${PUBSUB_SOURCES}
34
35
)
Original file line number Diff line number Diff line change 59
59
modules/grpc/pubsub modules/grpc/pubsub/ mod-pubsub :
60
60
endif
61
61
62
+ modules/grpc/pubsub/pubsub-grammar.y : modules/grpc/common/grpc-grammar.ym
63
+
62
64
BUILT_SOURCES += \
63
65
modules/grpc/pubsub/pubsub-grammar.y \
64
66
modules/grpc/pubsub/pubsub-grammar.c \
You can’t perform that action at this time.
0 commit comments