diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml index 2f5c1ab..37449b0 100644 --- a/.github/workflows/publish_pypi.yml +++ b/.github/workflows/publish_pypi.yml @@ -96,7 +96,7 @@ jobs: mv ~/osxcross ~/.osxcross fi - - name: Prefer system Eigen in the libczirw cmake build + - name: Tune the libczirw-sys cmake build (system Eigen, dynamic CRT) run: | # libczirw-sys cmake build clones Eigen3 from gitlab.com (ExternalProject); # that clone is flaky on this runner (it is the only git-based network step @@ -106,10 +106,16 @@ jobs: # variable from the environment, so a cmake shim injects it (-D); the shim is # scoped to invocations that look like the libczi configure (no-op for # --build / --version / other uses). + # the override also aligns the msvc CRT: libCZI forces the static runtime + # (/MT) while the rest of the build (Rust std, cc-compiled vendored libs, + # /defaultlib:msvcrt) is dynamic (/MD), and lld-link rejects the mix with + # /failifmismatch:RuntimeLibrary. no effect on the non-windows builds. mkdir -p /root/ci-shims cat > /root/cm-override-libczi.cmake <<'CMAKEEOF' if (CMAKE_PROJECT_NAME STREQUAL "libCZI") set(LIBCZI_BUILD_PREFER_EXTERNALPACKAGE_EIGEN3 ON CACHE BOOL "" FORCE) + set(LIBCZI_DO_NOT_SET_MSVC_RUNTIME_LIBRARY ON CACHE BOOL "" FORCE) + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDLL$<$:Debug>" CACHE STRING "" FORCE) endif() CMAKEEOF cat > /root/ci-shims/cmake <<'SHIMEOF'