Skip to content

Commit 2ff31f1

Browse files
committed
Try to pass -fno-aligned-allocation on Intel MacOS
1 parent 6aede52 commit 2ff31f1

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ nanobind_add_module(
2525
)
2626
target_include_directories(_core PRIVATE include)
2727

28+
# Add -fno-aligned-allocation flag for macOS Intel architecture
29+
# If this is omitted, builds on MacOS intel will fail
30+
if(APPLE AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
31+
target_compile_options(_core PRIVATE -fno-aligned-allocation)
32+
endif()
33+
2834
nanobind_add_stub(
2935
mapbox_earcut_stubs
3036
MODULE _core

0 commit comments

Comments
 (0)