-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update build scripts and documentation (#614)
IB-8160, IB-7900 Signed-off-by: Raul Metsma <[email protected]>
- Loading branch information
Showing
18 changed files
with
308 additions
and
294 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ jobs: | |
runs-on: macos-latest | ||
strategy: | ||
matrix: | ||
target: [osx, ios, iossimulator, androidarm, androidarm64, androidx86_64] | ||
target: [macos, iphoneos, iphonesimulator, androidarm, androidarm64, androidx86_64] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
@@ -21,7 +21,7 @@ jobs: | |
- name: Install dependencies | ||
run: | | ||
brew update | ||
brew install --formula swig doxygen boost | ||
brew install --formula ninja swig doxygen boost | ||
brew unlink [email protected] || true | ||
brew unlink [email protected] || true | ||
brew unlink xz | ||
|
@@ -48,22 +48,27 @@ jobs: | |
- name: Setup cache | ||
run: sudo ln -s $PWD/cache/* /Library/ | ||
- name: Build macOS | ||
if: matrix.target == 'osx' | ||
run: ./build-library.sh test pkcs11sign zipdebug embedlibs pkgbuild | ||
if: matrix.target == 'macos' | ||
run: | | ||
cmake --preset ${{ matrix.target }} -DCMAKE_BUILD_TYPE=RelWithDebInfo | ||
cmake --build --preset ${{ matrix.target }} | ||
cmake --build --preset ${{ matrix.target }} --target test pkcs11sign zipdebug embedlibs pkgbuild | ||
- name: Build ${{ matrix.target }} | ||
if: matrix.target != 'osx' | ||
if: matrix.target != 'macos' | ||
run: | | ||
./build-library.sh ${{ matrix.target }} install/strip | ||
cmake --preset ${{ matrix.target }} -DCMAKE_BUILD_TYPE=RelWithDebInfo | ||
cmake --build --preset ${{ matrix.target }} | ||
sudo cmake --build --preset ${{ matrix.target }} --target install/strip | ||
cd /Library | ||
zip -q -r ${OLDPWD}/libdigidocpp.${{ matrix.target }}.zip libdigidocpp.* | ||
- name: Archive artifacts | ||
if: matrix.target == 'osx' | ||
if: matrix.target == 'macos' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: macOS | ||
path: macOS/libdigidocpp*.* | ||
path: build/macos/libdigidocpp*.* | ||
- name: Archive artifacts | ||
if: matrix.target != 'osx' | ||
if: matrix.target != 'macos' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.target }} | ||
|
@@ -151,6 +156,7 @@ jobs: | |
env: | ||
VER_SUFFIX: .VS${{ matrix.toolset }} | ||
CXXFLAGS: '/D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR' # https://github.com/actions/runner-images/issues/10004 | ||
VCPKG_INSTALLED_DIR: ${{ github.workspace }}/vcpkg_installed | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
@@ -159,27 +165,27 @@ jobs: | |
- name: Prepare vcpkg | ||
uses: lukka/run-vcpkg@v11 | ||
with: | ||
vcpkgGitCommitId: 4065f37d0a6628ef17cf6ee15385f9091f1075bc | ||
vcpkgGitCommitId: 0f8b6ddf49fa8ae66a7826234e9ba3fda5f46d3c | ||
vcpkgJsonGlob: ./vcpkg.json | ||
runVcpkgInstall: true | ||
runVcpkgFormatString: "[`install`, `--recurse`, `--clean-after-build`, `--x-install-root`, `$[env.VCPKG_INSTALLED_DIR]`, `--triplet`, `$[env.VCPKG_DEFAULT_TRIPLET]`, `--x-feature`, `tests`]" | ||
env: | ||
VCPKG_DEFAULT_TRIPLET: ${{ matrix.platform }}-windows | ||
VCPKG_INSTALLED_DIR: ${{ github.workspace }}/vcpkg_installed | ||
- name: Install dependencies | ||
run: choco install doxygen.install -y > $null | ||
- uses: actions/setup-python@v5 | ||
if: matrix.platform == 'x86' | ||
with: | ||
python-version: 3.11 | ||
architecture: ${{ matrix.platform }} | ||
python-version: 3.12 | ||
architecture: x86 | ||
- name: Install WiX | ||
run: | | ||
dotnet tool install -g wix --version 5.0.0 | ||
wix extension -g add WixToolset.UI.wixext/5.0.0 | ||
dotnet tool install -g wix --version 5.0.1 | ||
wix extension -g add WixToolset.UI.wixext/5.0.1 | ||
- name: Build | ||
run: | | ||
& .\build.ps1 ` | ||
-vcpkg_installed ${{ github.workspace }}/vcpkg_installed ` | ||
-vcpkg_installed ${{ env.VCPKG_INSTALLED_DIR }} ` | ||
-vcvars "${{ matrix.vcvars }}" ` | ||
-platform ${{ matrix.platform }} ` | ||
-swig C:/ProgramData/chocolatey/bin/swig.exe ` | ||
|
@@ -269,9 +275,9 @@ jobs: | |
- name: Build | ||
run: | | ||
cmake -B build -S . \ | ||
-DSWIG_EXECUTABLE=NOTFOUND \ | ||
-DBoost_INCLUDE_DIR=NOTFOUND \ | ||
-DDOXYGEN_EXECUTABLE=NOTFOUND \ | ||
-DCMAKE_DISABLE_FIND_PACKAGE_SWIG=YES \ | ||
-DCMAKE_DISABLE_FIND_PACKAGE_Boost=YES \ | ||
-DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=YES \ | ||
-DBUILD_TOOLS=NO | ||
cmake --build build | ||
- name: Perform CodeQL Analysis | ||
|
@@ -285,7 +291,6 @@ jobs: | |
patterns: | | ||
-src/json.hpp | ||
-src/minizip/* | ||
-build/src/xml/* | ||
-**:cpp/poorly-documented-function | ||
-**:cpp/loop-variable-changed | ||
input: sarif-results/cpp.sarif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
{ | ||
"version": 6, | ||
"configurePresets": [ | ||
{ | ||
"name": "default", | ||
"displayName": "Default config", | ||
"description": "Default build using Ninja generator", | ||
"generator": "Ninja", | ||
"binaryDir": "${sourceDir}/build/${presetName}" | ||
}, | ||
{ | ||
"name": "base", | ||
"displayName": "macOS base build config", | ||
"hidden": true, | ||
"inherits": "default", | ||
"condition": { | ||
"type": "equals", | ||
"lhs": "${hostSystemName}", | ||
"rhs": "Darwin" | ||
}, | ||
"environment": { | ||
"DEST": "/Library/libdigidocpp$env{DEST_SUFFIX}" | ||
}, | ||
"installDir": "$env{DEST}", | ||
"cacheVariables": { | ||
"CMAKE_BUILD_TYPE": "Debug", | ||
"CMAKE_FIND_ROOT_PATH": "$env{DEST};/usr/local;/opt/homebrew" | ||
} | ||
}, | ||
{ | ||
"name": "macos", | ||
"inherits": "base", | ||
"description": "This macos build is only available on macOS", | ||
"cacheVariables": { | ||
"CMAKE_OSX_ARCHITECTURES": "arm64;x86_64", | ||
"CMAKE_OSX_DEPLOYMENT_TARGET": "12.0" | ||
} | ||
}, | ||
{ | ||
"name": "mobile", | ||
"hidden": true, | ||
"inherits": "base", | ||
"environment": { | ||
"DEST_SUFFIX": ".${presetName}" | ||
}, | ||
"cacheVariables": { | ||
"CMAKE_DISABLE_FIND_PACKAGE_Boost": "YES", | ||
"CMAKE_DISABLE_FIND_PACKAGE_Doxygen": "YES", | ||
"BUILD_TOOLS": "NO" | ||
} | ||
}, | ||
{ | ||
"name": "ios", | ||
"hidden": true, | ||
"inherits": "mobile", | ||
"cacheVariables": { | ||
"CMAKE_SYSTEM_NAME": "iOS", | ||
"CMAKE_OSX_SYSROOT": "${presetName}", | ||
"CMAKE_OSX_DEPLOYMENT_TARGET": "15.0", | ||
"CMAKE_OSX_ARCHITECTURES": "arm64;x86_64", | ||
"CMAKE_DISABLE_FIND_PACKAGE_SWIG": "YES", | ||
"FRAMEWORK_DESTINATION": "$env{DEST}/lib" | ||
} | ||
}, | ||
{ | ||
"name": "iphoneos", | ||
"inherits": "ios", | ||
"description": "This iphoneos build is only available on macOS", | ||
"cacheVariables": { | ||
"CMAKE_OSX_ARCHITECTURES": "arm64" | ||
} | ||
}, | ||
{ | ||
"name": "iphonesimulator", | ||
"inherits": "ios", | ||
"description": "This iphonesimulator build is only available on macOS" | ||
}, | ||
{ | ||
"name": "iphonecatalyst", | ||
"inherits": "ios", | ||
"description": "This iphonecatalyst build is only available on macOS", | ||
"cacheVariables": { | ||
"CMAKE_OSX_SYSROOT": "macosx" | ||
} | ||
}, | ||
{ | ||
"name": "android", | ||
"hidden": true, | ||
"inherits": "mobile", | ||
"cacheVariables": { | ||
"CMAKE_SYSTEM_NAME": "Android", | ||
"CMAKE_SYSTEM_VERSION": "30", | ||
"CMAKE_DISABLE_FIND_PACKAGE_Python3": "YES", | ||
"BUILD_SHARED_LIBS": "NO" | ||
} | ||
}, | ||
{ | ||
"name": "androidarm", | ||
"inherits": "android", | ||
"description": "androidarm build is only available on macOS", | ||
"cacheVariables": { | ||
"CMAKE_ANDROID_ARCH_ABI": "armeabi-v7a" | ||
} | ||
}, | ||
{ | ||
"name": "androidarm64", | ||
"inherits": "android", | ||
"description": "androidarm64 build is only available on macOS", | ||
"cacheVariables": { | ||
"CMAKE_ANDROID_ARCH_ABI": "arm64-v8a" | ||
} | ||
}, | ||
{ | ||
"name": "androidx86_64", | ||
"inherits": "android", | ||
"description": "androidx86_64 build is only available on macOS", | ||
"cacheVariables": { | ||
"CMAKE_ANDROID_ARCH_ABI": "x86_64" | ||
} | ||
} | ||
], | ||
"buildPresets": | ||
[ | ||
{ | ||
"name": "macos", | ||
"configurePreset": "macos" | ||
}, | ||
{ | ||
"name": "iphoneos", | ||
"configurePreset": "iphoneos" | ||
}, | ||
{ | ||
"name": "iphonesimulator", | ||
"configurePreset": "iphonesimulator" | ||
}, | ||
{ | ||
"name": "iphonecatalyst", | ||
"configurePreset": "iphonecatalyst" | ||
}, | ||
{ | ||
"name": "androidarm", | ||
"configurePreset": "androidarm" | ||
}, | ||
{ | ||
"name": "androidarm64", | ||
"configurePreset": "androidarm64" | ||
}, | ||
{ | ||
"name": "androidx86_64", | ||
"configurePreset": "androidx86_64" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.