Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down