wjakob / nanobind

nanobind: tiny and efficient C++/Python bindings
BSD 3-Clause "New" or "Revised" License
2.14k stars 161 forks source link

[BUG]: Mac Universal build for x86_64 and arm64 CMakeLists have no effect #572

Closed petrasvestartas closed 1 month ago

petrasvestartas commented 1 month ago

Problem description

I am using nanobind example.

I want to build a wheel that is universal both for x86_64 and arm64 Mac OS. Normally I set OS architecture, but for Nanobind they are always empty.

Why?

Reproducible example code

set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "Build architectures for Mac OS X")
message(STATUS "Building for architectures: ${CMAKE_OSX_ARCHITECTURES}")
wjakob commented 1 month ago

No idea, and unfortunately beyond the scope of what I can support here. At the end of the day, nanobind just uses standard commands like add_library, and if those don't deal with multiple architectures, there is likely a larger CMake issue. I suggest that you take it up with them.