From 549812c51c6aefcdbf95ed82bb3da991cd3acd5a Mon Sep 17 00:00:00 2001 From: krande Date: Mon, 11 Apr 2022 13:45:12 +0200 Subject: [PATCH] use manually installed MacOSX SDK on github runner. Minor rewrite of dynamic/static zlib conditional for conda_build. --- .github/workflows/ci-daily-build.yml | 6 ++++++ cmake/CMakeLists.txt | 26 ++++++++++++++++++++------ conda/conda_build_config.yaml | 2 +- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-daily-build.yml b/.github/workflows/ci-daily-build.yml index 796ef9a0ca..f24dcd8e6e 100644 --- a/.github/workflows/ci-daily-build.yml +++ b/.github/workflows/ci-daily-build.yml @@ -31,6 +31,12 @@ jobs: - uses: actions/checkout@v2 with: submodules: recursive + - name: Download MacOSX SDK + run: | + curl -o MacOSX10.13.sdk.tar.xz -L https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.13.sdk.tar.xz.tar.xz && \ + tar xf MacOSX10.13.sdk.tar.xz && \ + sudo mv -v MacOSX10.13.sdk /opt/ && \ + ls /opt/ - uses: seanmiddleditch/gha-setup-ninja@master - uses: conda-incubator/setup-miniconda@v2 # https://github.com/conda-incubator/setup-miniconda with: diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 45c1edb163..346ffec7af 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -441,7 +441,8 @@ if(HDF5_SUPPORT) if (HDF5_LIBRARY_DIR) # result of the HDF5 ctest package - + # Find zlib using cmake find_library. How should this be implemented? + # FIND_LIBRARY(NAMES z libz libz_debug PATHS ... NO_DEFAULT_PATH) if (WIN32) # Windows @@ -457,12 +458,25 @@ if(HDF5_SUPPORT) set(lib_ext so) endif() + if ("$ENV{CONDA_BUILD}" STREQUAL "") + if (WIN32) + # Should we use dynamic dll for windows also? + #set(lib_ext dll) + else() + set(lib_ext a) + endif() + endif() + + if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") + set(debug_postfix "_debug") + endif() + SET(HDF5_LIBRARIES - "${HDF5_LIBRARY_DIR}/libhdf5_cpp.${lib_ext}" - "${HDF5_LIBRARY_DIR}/libhdf5.${lib_ext}" - "${HDF5_LIBRARY_DIR}/${zlib_post}.${lib_ext}" -# "${HDF5_LIBRARY_DIR}/libsz.${lib_ext}" -# "${HDF5_LIBRARY_DIR}/libaec.${lib_ext}" + "${HDF5_LIBRARY_DIR}/libhdf5_cpp${debug_postfix}.${lib_ext}" + "${HDF5_LIBRARY_DIR}/libhdf5${debug_postfix}.${lib_ext}" + "${HDF5_LIBRARY_DIR}/${zlib_post}${debug_postfix}.${lib_ext}" +# "${HDF5_LIBRARY_DIR}/libsz${debug_postfix}.${lib_ext}" +# "${HDF5_LIBRARY_DIR}/libaec${debug_postfix}.${lib_ext}" ) endif() diff --git a/conda/conda_build_config.yaml b/conda/conda_build_config.yaml index bac5cfc382..5a72b972fe 100644 --- a/conda/conda_build_config.yaml +++ b/conda/conda_build_config.yaml @@ -1,2 +1,2 @@ CONDA_BUILD_SYSROOT: - - /Applications/Xcode_13.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk # [osx] \ No newline at end of file + - /opt/MacOSX10.13.sdk # [osx] \ No newline at end of file