File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -103,19 +103,23 @@ function(generate_type_stubs module_name depends_target mlir_depends_target outp
103
103
if (EXISTS ${nanobind_DIR} /../src/stubgen.py )
104
104
set (NB_STUBGEN "${nanobind_DIR} /../src/stubgen.py" )
105
105
elseif (EXISTS ${nanobind_DIR} /../stubgen.py )
106
- set (NB_STUBGEN "${nanobind_DIR} /../stubgen.py" )
106
+ set (NB_STUBGEN "${nanobind_DIR} /../stubgen.py" )
107
107
else ()
108
- message (FATAL_ERROR "generate_type_stubs(): could not locate 'stubgen.py'!" )
108
+ message (FATAL_ERROR "generate_type_stubs(): could not locate 'stubgen.py'!" )
109
109
endif ()
110
+ file (REAL_PATH "${NB_STUBGEN} " NB_STUBGEN )
110
111
111
112
set (_module "${MLIR_PYTHON_PACKAGE_PREFIX} ._mlir_libs.${module_name} " )
113
+ file (REAL_PATH "${MLIR_BINARY_DIR} /${MLIR_BINDINGS_PYTHON_INSTALL_PREFIX} /.." _import_path )
114
+ # file(TO_NATIVE_PATH ${_import_path} _import_path)
115
+
112
116
set (NB_STUBGEN_CMD
113
117
"${Python_EXECUTABLE} "
114
118
"${NB_STUBGEN} "
115
119
--module
116
120
"${_module} "
117
121
-i
118
- "${MLIR_BINARY_DIR} / ${MLIR_BINDINGS_PYTHON_INSTALL_PREFIX} /.. "
122
+ "${_import_path} "
119
123
--recursive
120
124
--include-private
121
125
--output-dir
@@ -125,7 +129,7 @@ function(generate_type_stubs module_name depends_target mlir_depends_target outp
125
129
add_custom_command (
126
130
OUTPUT ${NB_STUBGEN_OUTPUT}
127
131
COMMAND ${NB_STUBGEN_CMD}
128
- WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR } "
132
+ WORKING_DIRECTORY "${CMAKE_CURRENT_FUNCTION_LIST_DIR } "
129
133
DEPENDS "${mlir_depends_target} " "${depends_target} " )
130
134
set (_name "MLIRPythonModuleStubs_${_module} " )
131
135
add_custom_target ("${_name} " ALL DEPENDS ${NB_STUBGEN_OUTPUT} )
You can’t perform that action at this time.
0 commit comments