-
MLIR Python bindings are now using nanobind (migrated from pybind11 by @hawkinsp). This approach however does not work due to nanobind target library name changes according to the options passed to The question: @wjakob, would it be acceptable to add an optional arg to function(nanobind_add_module name)
cmake_parse_arguments(PARSE_ARGV 1 ARG
"STABLE_ABI;FREE_THREADED;NB_STATIC;NB_SHARED;PROTECT_STACK;LTO;NOMINSIZE;NOSTRIP;MUSL_DYNAMIC_LIBCPP"
"NB_DOMAIN" "NBLIB_COMPILE_OPTIONS")
...
add_library(${name} MODULE ${ARG_UNPARSED_ARGUMENTS})
...
nanobind_build_library(${libname})
if (ARG_NB_COMPILE_OPTIONS)
target_compile_options(
${libname}
PRIVATE
${ARG_NBLIB_COMPILE_OPTIONS}
)
endif()
...
endfunction() If you have a better suggestion please share it as well. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 7 replies
-
That's cool! I have concerns about What's the issue with inferring |
Beta Was this translation helpful? Give feedback.
-
Would it work for everyone if nanobind were to set a |
Beta Was this translation helpful? Give feedback.
-
Instead of a cache variable, maybe target properties are worth investigating?
prints
|
Beta Was this translation helpful? Give feedback.
-
Note that #868 has been merged, so using |
Beta Was this translation helpful? Give feedback.
@vfdev-5 Is the ability to compute the target name still relevant given the addition of
NB_SUPPRESS_WARNINGS
?