From e227de0588d7a45015aef15c1a6070e78b67817b Mon Sep 17 00:00:00 2001 From: Ryan Mast Date: Fri, 2 Feb 2024 21:05:50 -0800 Subject: [PATCH] Add logic for picking pre-compiled binary to download --- .github/workflows/pythonpackage.yml | 2 +- helics_apps-pip/CMakeLists.txt | 30 ++++++++++++++++------------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index e796079..0391994 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -46,7 +46,7 @@ jobs: build: "" artifact_suffix: "windows_x86" use_qemu: false - - os: macos-14 + - os: macos-13 arch: "universal2" build: "" artifact_suffix: "macos" diff --git a/helics_apps-pip/CMakeLists.txt b/helics_apps-pip/CMakeLists.txt index 2680d85..ef6ea34 100644 --- a/helics_apps-pip/CMakeLists.txt +++ b/helics_apps-pip/CMakeLists.txt @@ -1,19 +1,23 @@ cmake_minimum_required(VERSION 3.15...3.26) project(HELICS LANGUAGES CXX) # Must be "HELICS" due to its CMake files requiring CMAKE_PROJECT_NAME == PROJECT_NAME in order to build app executables -message(STATUS "--------------------") -message(STATUS "SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P}") # if(CMAKE_SIZEOF_VOID_P EQUAL 8) -message(STATUS "CMAKE_GENERATOR ${CMAKE_GENERATOR}") -message(STATUS "INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}") -message(STATUS "SYSTEM ${CMAKE_SYSTEM}") -message(STATUS "SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR}") -message(STATUS "SYSTEM_VERSION ${CMAKE_SYSTEM_VERSION}") -message(STATUS "SYSTEM_NAME ${CMAKE_SYSTEM_NAME}") -message(STATUS "APPLE ${APPLE}") -message(STATUS "LINUX ${LINUX}") -message(STATUS "UNIX ${UNIX}") -message(STATUS "WIN32 ${WIN32}") -message(STATUS "ENV(TEST_ENV_VAR) $ENV{TEST_ENV_VAR}") +# Note: This will likely not produce valid wheels for musl systems... +if(LINUX AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(HELICS_DOWNLOAD_URL https://github.com/GMLC-TDC/HELICS/releases/download/v${SKBUILD_PROJECT_VERSION}/Helics-${SKBUILD_PROJECT_VERSION}-Linux-x86_64.tar.gz) +elseif(APPLE AND CMAKE_SYSTEM_NAME STREQUAL "Darwin") + message(STATUS "${CMAKE_SYSTEM_PROCESSOR}") + set(HELICS_DOWNLOAD_URL https://github.com/GMLC-TDC/HELICS/releases/download/${SKBUILD_PROJECT_VERSION}/Helics-${SKBUILD_PROJECT_VERSION}-macOS-universal2.zip) +elseif(WIN32) + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(HELICS_DOWNLOAD_URL https://github.com/GMLC-TDC/HELICS/releases/download/v${SKBUILD_PROJECT_VERSION}/Helics-${SKBUILD_PROJECT_VERSION}-win64.zip) + elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) + set(HELICS_DOWNLOAD_URL https://github.com/GMLC-TDC/HELICS/releases/download/v${SKBUILD_PROJECT_VERSION}/Helics-${SKBUILD_PROJECT_VERSION}-win32.zip) + endif() +endif() + +message(STATUS "CIBW_BUILD: $ENV{CIBW_BUILD}") +message(STATUS "CIBUILDWHEEL: $ENV{CIBUILDWHEEL}") +message(STATUS "DOWNLOAD URL: ${HELICS_DOWNLOAD_URL}") return() message(STATUS ${SKBUILD_PROJECT_NAME})