Skip to content

Commit a77cb19

Browse files
authored
Build webots-controller for both x86 and arm on MacOS (cyberbotics#6806)
* build webots-controller for both x86 and arm on macos * update the changelog * use gcc instead of cxx * create a build directory
1 parent c098bdf commit a77cb19

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

docs/reference/changelog-r2025.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Webots R2025 Change Log
22

3+
## Webots R2025b
4+
- Bug Fixes
5+
- Fixed a bug preventing the `webots-controller` executable from running on arm-based mac devices ([#6806](https://github.com/cyberbotics/webots/pull/6806)).
6+
37
## Webots R2025a
48
Released on January 31st, 2025.
59
- New Features
@@ -24,7 +28,7 @@ Released on January 31st, 2025.
2428
- Improved the image range of the rotating [Lidar](lidar.md) ([#6324](https://github.com/cyberbotics/webots/pull/6324)).
2529
- Show box-plane contact point normals when showing contact points ([#6678](https://github.com/cyberbotics/webots/pull/6678)).
2630
- Improved the speed and accuracy of box-plane collisions ([#6688](https://github.com/cyberbotics/webots/pull/6688)).
27-
- Enabled the launching of MATLAB desktop from the extern launcher ([#6366](https://github.com/cyberbotics/webots/pull/6366)).
31+
- Enabled the launching of MATLAB desktop from the extern launcher ([#6366](https://github.com/cyberbotics/webots/pull/6366)).
2832
- Improved overlays visible in Overlays menu by adding all the robots in the menu list ([#6297](https://github.com/cyberbotics/webots/pull/6297)).
2933
- Cleanup
3034
- Removed deprecated `windowPosition`, `pixelSize` fields of [Display](display.md) node ([#6327](https://github.com/cyberbotics/webots/pull/6327)).

src/controller/launcher/Makefile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,30 @@ endif
4141

4242
release debug profile: $(CONTROLLER_LAUNCHER)
4343

44+
ifeq ($(OSTYPE),darwin)
45+
46+
OBJDIR = build/$(MAKECMDGOALS)
47+
BUILD_PATH_SETUP := $(shell mkdir -p $(OBJDIR)/x86_64 $(OBJDIR)/arm64)
48+
49+
$(CONTROLLER_LAUNCHER): $(OBJDIR)/x86_64/webots-controller $(OBJDIR)/arm64/webots-controller
50+
@echo "# creating fat " $(notdir $@)
51+
@lipo -create -output $@ $(OBJDIR)/x86_64/webots-controller $(OBJDIR)/arm64/webots-controller
52+
@codesign -s - $@
53+
54+
$(OBJDIR)/x86_64/webots-controller: webots_controller.c
55+
@echo "# compiling " $@ "(x64_64)"
56+
@gcc $(CFLAGS) -target x86_64-apple-macos12 webots_controller.c -o $@
57+
58+
$(OBJDIR)/arm64/webots-controller: webots_controller.c
59+
@echo "# compiling " $@ "(arm64)"
60+
@gcc $(CFLAGS) -target arm64-apple-macos12 webots_controller.c -o $@
61+
62+
else
63+
4464
$(CONTROLLER_LAUNCHER): webots_controller.c
4565
@echo "# compiling" $<
4666
@gcc $(CFLAGS) webots_controller.c -o $@
4767

68+
endif
69+
4870
FILES_TO_REMOVE += $(CONTROLLER_LAUNCHER)

0 commit comments

Comments
 (0)