@@ -77,7 +77,8 @@ endfunction()
77
77
# handle_gyb_sources(
78
78
# dependency_out_var_name
79
79
# sources_var_name
80
- # arch)
80
+ # [ARCH arch]
81
+ # [DEPENDS [depends ...]])
81
82
#
82
83
# Replace, in ${sources_var_name}, the given .gyb-suffixed sources with
83
84
# their un-suffixed intermediate files, which will be generated by processing
@@ -93,11 +94,21 @@ endfunction()
93
94
# false, the files are architecture-independent and will be emitted
94
95
# into ${CMAKE_CURRENT_BINARY_DIR} instead of an architecture-specific
95
96
# destination; this is useful for generated include files.
96
- function (handle_gyb_sources dependency_out_var_name sources_var_name arch)
97
+ #
98
+ # depends
99
+ # Additional file dependencies beyond the standard dependencies that all gyb
100
+ # invocations get.
101
+ function (handle_gyb_sources dependency_out_var_name sources_var_name)
102
+ set (options )
103
+ set (single_value_args ARCH)
104
+ set (multi_value_args DEPENDS )
105
+ cmake_parse_arguments (GYB
106
+ "${options} " "${single_value_args} " "${multi_value_args} " ${ARGN} )
107
+
97
108
set (extra_gyb_flags "" )
98
- if (arch )
109
+ if (GYB_ARCH )
99
110
set_if_arch_bitness(ptr_size
100
- ARCH "${arch } "
111
+ ARCH "${GYB_ARCH } "
101
112
CASE_32_BIT "4"
102
113
CASE_64_BIT "8" )
103
114
set (extra_gyb_flags "-DCMAKE_SIZEOF_VOID_P=${ptr_size} " )
@@ -141,7 +152,7 @@ function(handle_gyb_sources dependency_out_var_name sources_var_name arch)
141
152
set (dir_root ${CMAKE_CURRENT_BINARY_DIR} )
142
153
endif ()
143
154
144
- if (arch )
155
+ if (GYB_ARCH )
145
156
set (dir "${dir_root} /${ptr_size} " )
146
157
else ()
147
158
set (dir "${dir_root} " )
@@ -154,7 +165,7 @@ function(handle_gyb_sources dependency_out_var_name sources_var_name arch)
154
165
SOURCE "${src} "
155
166
OUTPUT "${output_file_name} "
156
167
FLAGS ${extra_gyb_flags}
157
- DEPENDS "${gyb_extra_sources} "
168
+ DEPENDS "${GYB_DEPENDS} " " ${ gyb_extra_sources} "
158
169
COMMENT "with ptr size = ${ptr_size} " )
159
170
list (APPEND dependency_targets "${dependency_target} " )
160
171
endforeach ()
@@ -163,13 +174,7 @@ function(handle_gyb_sources dependency_out_var_name sources_var_name arch)
163
174
endfunction ()
164
175
165
176
function (add_gyb_target target sources )
166
- set (options )
167
- set (single_value_args ARCH)
168
- set (multi_value_args)
169
- cmake_parse_arguments (GYB
170
- "${options} " "${single_value_args} " "${multi_value_args} " ${ARGN} )
171
-
172
- handle_gyb_sources(gyb_sources_depends sources "${GYB_ARCH} " )
177
+ handle_gyb_sources(gyb_sources_depends sources ${ARGN} )
173
178
174
179
add_custom_target (${target}
175
180
DEPENDS "${gyb_sources_depends} " )
0 commit comments