diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7a73e63..c23c64d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,12 @@ jobs: # Include macos-13 to get Intel x86_64 macs and maos-latest to get the Aaarch64 macs os: [ubuntu-latest, macos-latest, macos-13, windows-2022] + # Build on the native architectures (macos-latest is arm64. macos-13 is x86_64) + include: + - os: macos-latest + osx_arch: 'arm64' + - os: macos-13 + osx_arch: 'x86_64' steps: - uses: actions/checkout@master with: @@ -42,7 +48,7 @@ jobs: # Skip testing on arm64 Python 3.8 because it uses the x86_64 executable, not the arm executable CIBW_TEST_SKIP: "cp38-macosx_*:arm64" CIBW_ENVIRONMENT_LINUX: CMAKE_GENERATOR="Unix Makefiles" - CIBW_ENVIRONMENT_MACOS: CMAKE_GENERATOR="Unix Makefiles" + CIBW_ENVIRONMENT_MACOS: CMAKE_GENERATOR="Unix Makefiles" CMAKE_OSX_ARCHITECTURES=${{ matrix.osx_arch }} CIBW_ENVIRONMENT_WINDOWS: CMAKE_GENERATOR="Visual Studio 17 2022" CMAKE_GENERATOR_PLATFORM=x64 CIBW_BUILD_VERBOSITY: 1 run: | diff --git a/c/CMakeLists.txt b/c/CMakeLists.txt index 8c3835d..728204d 100644 --- a/c/CMakeLists.txt +++ b/c/CMakeLists.txt @@ -1,8 +1,12 @@ -cmake_minimum_required (VERSION 3.2) +cmake_minimum_required (VERSION 3.5) # Project name project (qdldl_amd) +if(APPLE) + message(STATUS "Building for Apple arches: ${CMAKE_OSX_ARCHITECTURES}") +endif() + # Needed for compilation to succeed set(CMAKE_POSITION_INDEPENDENT_CODE ON) diff --git a/setup.py b/setup.py index dc9b8b7..30c8768 100644 --- a/setup.py +++ b/setup.py @@ -35,14 +35,14 @@ def __str__(self): cmake_args = [] # What variables from the environment do we wish to pass on to cmake as variables? -cmake_env_vars = ('CMAKE_GENERATOR', 'CMAKE_GENERATOR_PLATFORM') +cmake_env_vars = ('CMAKE_GENERATOR', 'CMAKE_GENERATOR_PLATFORM', 'CMAKE_OSX_ARCHITECTURES') for cmake_env_var in cmake_env_vars: cmake_var = os.environ.get(cmake_env_var) if cmake_var: cmake_args.extend([f'-D{cmake_env_var}={cmake_var}']) # Add parameters to cmake_args and define_macros -cmake_args += ["-DUNITTESTS=OFF"] +cmake_args += ["-DQDLDL_UNITTESTS=OFF"] cmake_build_flags = [] lib_subdir = []