Skip to content

Commit b682fc8

Browse files
author
Martin Urban
committed
Update GitHub actions yaml
1 parent e311ba8 commit b682fc8

File tree

3 files changed

+27
-9
lines changed

3 files changed

+27
-9
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,3 +185,4 @@ cython_debug/
185185
/pymol/
186186
/pre-built/macos/lib_64/
187187
/pre-built/linux/lib_64/
188+
/cmake-build-release-arm64/

CMakeLists.txt

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
cmake_minimum_required(VERSION 3.13)
22
project(_cmd)
33

4+
if (${CMAKE_OSX_ARCHITECTURES} STREQUAL "arm64")
5+
message("Build for arm64 macOS")
6+
# Here is knowledge about arm64 macOS needed
7+
find_package(Python3 ${PYTHON_VER} EXACT COMPONENTS Development REQUIRED)
8+
set(LIB_DIR ${CMAKE_SOURCE_DIR}/vcpkg_installed/arm64-osx/lib)
9+
set(PY_LIB Python3::Python)
10+
else ()
11+
message("Build for x86_64 macOS")
12+
find_package(Python3 ${PYTHON_VER} EXACT COMPONENTS Development REQUIRED)
13+
set(PY_LIB Python3::Python)
14+
set(LIB_DIR ${CMAKE_SOURCE_DIR}/vcpkg_installed/x64-osx/lib)
15+
endif ()
16+
417
set(CMAKE_VERBOSE_MAKEFILE on)
518

619
set(ALL_SRC
@@ -253,9 +266,6 @@ set(ALL_COMP_ARGS
253266
)
254267
target_compile_options(_cmd PRIVATE ${ALL_COMP_ARGS})
255268

256-
# Set Python paths manually
257-
find_package(Python3 ${PYTHON_VER} EXACT COMPONENTS Development REQUIRED)
258-
259269
#set(SHARED_SUFFIX .cpython-311-darwin.so)
260270
set_target_properties(_cmd PROPERTIES SUFFIX ${SHARED_SUFFIX})
261271

@@ -298,15 +308,12 @@ set (ALL_INC_DIR
298308

299309
target_include_directories(_cmd PUBLIC ${ALL_INC_DIR})
300310

301-
target_link_directories(_cmd PRIVATE ${CMAKE_SOURCE_DIR}/vcpkg_installed/x64-osx/lib)
302-
target_link_options(_cmd PRIVATE
303-
-framework OpenGL
304-
#-undefined dynamic_lookup
305-
)
311+
target_link_directories(_cmd PRIVATE ${LIB_DIR})
312+
target_link_options(_cmd PRIVATE -framework OpenGL)
306313

307314
target_link_libraries(
308315
_cmd PRIVATE
309-
PNG::PNG freetype xml2 GLEW netCDF::netcdf OpenGL::GL Python3::Python
316+
PNG::PNG freetype xml2 GLEW netCDF::netcdf OpenGL::GL ${PY_LIB}
310317
)
311318

312319
set(ALL_DEF

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,16 @@ icon in the bottom left panel and click on the `Gear icon > CMake Settings`)
112112
5. **Optional**: If you now run `./run_automation.sh build-wheel` the new
113113
wheel file will automatically use your self built `_cmd` module.
114114
115+
## arm64 builds
116+
Currently, arm64 builds are **not** supported. However, it is worked on,
117+
to support this kind of architecture.
118+
119+
### CPython under arm64
120+
To build the _cmd module a CPython version that is build for amr64
121+
is necessary. For intel-based Macs CPython has to be compiled from source.
122+
To do this clone the cpython repo and checkout this commit hash:
123+
`d03b868578a29d9d64f829459b584eed48862056`
124+
115125
## Roadmap
116126
Until now the build wheel file can only be used with Python 3.11.
117127
The plan for the future is to support multiple different Python versions.

0 commit comments

Comments
 (0)