diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 508f88d..c27c17f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -245,28 +245,32 @@ jobs: cmake -S . -B build ` -DCMAKE_INSTALL_PREFIX=C:\olm-install ` -DCMAKE_BUILD_TYPE=Release ` - -DBUILD_SHARED_LIBS=OFF + -DBUILD_SHARED_LIBS=ON cmake --build build --config Release cmake --install build --config Release # Debug: Show what files were created - Write-Host "Contents of C:\olm-install\lib:" - Get-ChildItem -Path C:\olm-install\lib -Recurse + Write-Host "Contents of C:\olm-install:" + Get-ChildItem -Path C:\olm-install -Recurse | Select-Object FullName, Length - # python-olm expects olm.lib, but CMake creates olm_static.lib when BUILD_SHARED_LIBS=OFF - # Copy the static library with the expected name - if (Test-Path "C:\olm-install\lib\olm_static.lib") { - Copy-Item "C:\olm-install\lib\olm_static.lib" "C:\olm-install\lib\olm.lib" - Write-Host "Copied olm_static.lib to olm.lib" - } else { - Write-Error "ERROR: olm_static.lib not found in C:\olm-install\lib. Build cannot continue." + # Verify that olm.dll and olm.lib were created successfully + # CMake with BUILD_SHARED_LIBS=ON creates olm.dll (shared library) and olm.lib (import library) + if (-not (Test-Path "C:\olm-install\bin\olm.dll")) { + Write-Error "ERROR: olm.dll not found in C:\olm-install\bin. Build cannot continue." + exit 1 + } + if (-not (Test-Path "C:\olm-install\lib\olm.lib")) { + Write-Error "ERROR: olm.lib not found in C:\olm-install\lib. Build cannot continue." exit 1 } + Write-Host "Successfully built olm.dll and olm.lib" # Set environment variables for python-olm build # Include both the include and lib paths, and also set CMAKE_PREFIX_PATH for FindOlm + # Add bin directory to PATH so the DLL can be found at runtime echo "INCLUDE=C:\olm-install\include;$env:INCLUDE" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "LIB=C:\olm-install\lib;$env:LIB" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + echo "PATH=C:\olm-install\bin;$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "CMAKE_PREFIX_PATH=C:\olm-install;$env:CMAKE_PREFIX_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Install dependencies diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f2fecf..62e36d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ and this project adheres to Semantic Calendar Versioning with format YYYY.MM.DD. - Installed libolm build dependency via homebrew on macOS - Setup CMake and libolm build environment on Windows - **Windows Build**: Patched libolm CMakeLists.txt to require CMake 3.5+ for compatibility + - **Windows Build**: Fixed libolm build to create shared library (DLL) instead of static library - python-olm requires olm.dll and olm.lib (import library) - **macOS Build**: Set CFLAGS and LDFLAGS to use homebrew libolm instead of building from source - Fixed compatibility issues with python-olm native extension builds - Enhanced Windows libolm build configuration with CMAKE_BUILD_TYPE and proper install paths