File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
examples/standalone/python Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -113,11 +113,12 @@ endfunction()
113
113
# DEPENDS_TARGET_SRC_DEPS: List of cpp sources for extension library (for generating a DEPFILE).
114
114
# IMPORT_PATHS: List of paths to add to PYTHONPATH for stubgen.
115
115
# PATTERN_FILE: (Optional) Pattern file (see https://nanobind.readthedocs.io/en/latest/typing.html#pattern-files).
116
+ # VERBOSE: Emit logging/status messages during stub generation (default: OFF).
116
117
# Outputs:
117
118
# NB_STUBGEN_CUSTOM_TARGET: The target corresponding to generation which other targets can depend on.
118
119
function (mlir_generate_type_stubs)
119
120
cmake_parse_arguments (ARG
120
- ""
121
+ "VERBOSE "
121
122
"MODULE_NAME;OUTPUT_DIR;PATTERN_FILE"
122
123
"IMPORT_PATHS;DEPENDS_TARGETS;OUTPUTS;DEPENDS_TARGET_SRC_DEPS"
123
124
${ARGN} )
@@ -152,6 +153,9 @@ function(mlir_generate_type_stubs)
152
153
--include -private
153
154
--output -dir
154
155
"${ARG_OUTPUT_DIR} " )
156
+ if (NOT ARG_VERBOSE)
157
+ list (APPEND _nb_stubgen_cmd "--quiet" )
158
+ endif ()
155
159
if (ARG_PATTERN_FILE)
156
160
list (APPEND _nb_stubgen_cmd "-p;${ARG_PATTERN_FILE} " )
157
161
list (APPEND ARG_DEPENDS_TARGETS "${ARG_PATTERN_FILE} " )
@@ -166,7 +170,9 @@ function(mlir_generate_type_stubs)
166
170
file (GENERATE OUTPUT "${_depfile} " CONTENT "${_depfiles} " )
167
171
endif ()
168
172
169
- message (DEBUG "Generating type-stubs outputs ${_generated_type_stubs} " )
173
+ if (ARG_VERBOSE)
174
+ message (STATUS "Generating type-stubs outputs ${_generated_type_stubs} " )
175
+ endif ()
170
176
add_custom_command (
171
177
OUTPUT ${_generated_type_stubs}
172
178
COMMAND ${_nb_stubgen_cmd}
Original file line number Diff line number Diff line change @@ -92,6 +92,7 @@ if(NOT EXTERNAL_PROJECT_BUILD)
92
92
OUTPUTS "${_core_type_stub_sources} "
93
93
DEPENDS_TARGET_SRC_DEPS "${_core_extension_srcs} "
94
94
IMPORT_PATHS "${StandalonePythonModules_ROOT_PREFIX} /_mlir_libs"
95
+ VERBOSE
95
96
)
96
97
set (_mlir_typestub_gen_target "${NB_STUBGEN_CUSTOM_TARGET} " )
97
98
You can’t perform that action at this time.
0 commit comments