diff --git a/procgen/CMakeLists.txt b/procgen/CMakeLists.txt index 31084aa5..3693e42a 100644 --- a/procgen/CMakeLists.txt +++ b/procgen/CMakeLists.txt @@ -26,8 +26,14 @@ endif() if (APPLE OR UNIX) if(PROCGEN_PACKAGE) - # compile for the minimum spec processor - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -march=ivybridge") + # compile for the minimum spec processor (for a portable wheel) + if(CMAKE_SYSTEM_PROCESSOR MATCHES "arm64|aarch64") + # -march=ivybridge is an x86-only microarch and is rejected by arm64 clang; + # use the base armv8-a ISA so the wheel stays portable across Apple Silicon / aarch64. + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -march=armv8-a") + else() + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -march=ivybridge") + endif() else() set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -march=native") endif() diff --git a/procgen/builder.py b/procgen/builder.py index 53a6eef3..83dc128e 100644 --- a/procgen/builder.py +++ b/procgen/builder.py @@ -54,7 +54,11 @@ def _attempt_configure(build_type, package): cmake_prefix_paths = [os.environ["PROCGEN_CMAKE_PREFIX_PATH"]] else: # guess some common qt cmake paths, it's unclear why cmake can't find qt without this - cmake_prefix_paths = ["/usr/local/opt/qt5/lib/cmake"] + # (Apple Silicon Homebrew installs qt@5 under /opt/homebrew; Intel Homebrew under /usr/local) + cmake_prefix_paths = [ + "/usr/local/opt/qt5/lib/cmake", + "/opt/homebrew/opt/qt@5/lib/cmake", + ] conda_exe = shutil.which("conda") if conda_exe is not None: conda_info = json.loads( diff --git a/procgen/src/games/chaser.cpp b/procgen/src/games/chaser.cpp index a6ec0c8d..b0aaa2c2 100644 --- a/procgen/src/games/chaser.cpp +++ b/procgen/src/games/chaser.cpp @@ -293,7 +293,7 @@ class ChaserGame : public BasicAbstractGame { void game_step() override { BasicAbstractGame::game_step(); - int num_orbs = 0; + [[maybe_unused]] int num_orbs = 0; int num_enemies = 0; float default_enemy_speed = .5; diff --git a/procgen/src/games/starpilot.cpp b/procgen/src/games/starpilot.cpp index 9ea93e03..6b4ed8d6 100644 --- a/procgen/src/games/starpilot.cpp +++ b/procgen/src/games/starpilot.cpp @@ -228,7 +228,7 @@ class StarPilotGame : public BasicAbstractGame { bool can_spawn_left = options.distribution_mode != EasyMode; - for (int i = 0; t <= SHOOTER_WIN_TIME; i++) { + for ([[maybe_unused]] int i = 0; t <= SHOOTER_WIN_TIME; i++) { int group_size = 1; float start_weight = rand_gen.rand01() * total_prob_weight; float curr_weight = start_weight;