Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
arm64 support for lopsided98/nix-ros-overlay
this patch is based on release/humble/rviz_ogre_vendor/11.2.12-1 to support rviz2 on darwin-aarch64 for ros2-humble, see details at lopsided98/nix-ros-overlay#445 allow building arm64 ``` @@ -125,7 +125,11 @@ macro(build_ogre) set(OGRE_CXX_FLAGS "${OGRE_CXX_FLAGS} /w /EHsc") elseif(APPLE) set(OGRE_CXX_FLAGS "${OGRE_CXX_FLAGS} -std=c++14 -stdlib=libc++ -w") - list(APPEND extra_cmake_args "-DCMAKE_OSX_ARCHITECTURES='x86_64'") + if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm64") + list(APPEND extra_cmake_args "-DCMAKE_OSX_ARCHITECTURES='arm64'") + else() + list(APPEND extra_cmake_args "-DCMAKE_OSX_ARCHITECTURES='x86_64'") + endif() else() # Linux set(OGRE_C_FLAGS "${OGRE_C_FLAGS} -w") # include Clang -Wno-everything to disable warnings in that build. GCC doesn't mind it ``` solve `error: Objective-C was disabled in PCH file but is currently enabled` for Apple Silicon. `fix-arm64` is merged by upstream since v1.12.9, version bump is in nix-ros-overlay `override.nix`. ``` @@ -185,10 +188,10 @@ macro(build_ogre) -DOGRE_BUILD_COMPONENT_JAVA:BOOL=FALSE -DOGRE_BUILD_COMPONENT_CSHARP:BOOL=FALSE -DOGRE_BUILD_COMPONENT_BITES:BOOL=FALSE + -DOGRE_ENABLE_PRECOMPILED_HEADERS=0 ${extra_cmake_args} -Wno-dev PATCH_COMMAND ${Patch_EXECUTABLE} -p1 -N < ${CMAKE_CURRENT_SOURCE_DIR}/pragma-patch.diff && - ${Patch_EXECUTABLE} -p1 -N < ${CMAKE_CURRENT_SOURCE_DIR}/fix-arm64.diff && ${Patch_EXECUTABLE} -p1 -N < ${CMAKE_CURRENT_SOURCE_DIR}/relocatable.patch COMMAND ```
- Loading branch information