Skip to content

Commit

Permalink
feat: add support to setup Go on ARM64 macOS (#19)
Browse files Browse the repository at this point in the history
* feat: separate architecture for setting up Go on macOS

* feat: add support to set up Go on ARM64 macOS
  • Loading branch information
threeal authored Apr 22, 2024
1 parent a32ad2c commit f439e35
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cmake/SetupGo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,15 @@ function(setup_go)
set(URL https://go.dev/dl/go1.22.2.linux-amd64.tar.gz)
set(EXPECTED_MD5 f64eb5791a9dab9cbcdf6549b9583280)
elseif(CMAKE_SYSTEM_NAME STREQUAL Darwin)
set(URL https://go.dev/dl/go1.22.2.darwin-amd64.tar.gz)
set(EXPECTED_MD5 6a8e1186969f0ce1cc6fc2551d834c6b)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64)
set(URL https://go.dev/dl/go1.22.2.darwin-amd64.tar.gz)
set(EXPECTED_MD5 6a8e1186969f0ce1cc6fc2551d834c6b)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL arm64)
set(URL https://go.dev/dl/go1.22.2.darwin-arm64.tar.gz)
set(EXPECTED_MD5 e22bc1c8f6288159ee44ebe5823a3893)
else()
message(FATAL_ERROR "Unsupported architecture for setting up Go: ${CMAKE_SYSTEM_PROCESSOR}")
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL Windows)
set(URL https://go.dev/dl/go1.22.2.windows-amd64.zip)
set(EXPECTED_MD5 125813601d166b742b5ab86d986be78c)
Expand Down
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ function(add_cmake_test FILE)
NAME ${NAME}
COMMAND ${CMAKE_COMMAND}
-D CMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
-D CMAKE_SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR}
-D CMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}
-D CMAKE_BINARY_DIR=${CMAKE_CURRENT_SOURCE_DIR}/build
-D TEST_MATCHES=^${NAME}$
Expand Down

0 comments on commit f439e35

Please # to comment.