-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
283 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Vcpkg build | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
name: ${{ matrix.cfg.os }} | ||
runs-on: ${{ matrix.cfg.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
cfg: | ||
- { os: ubuntu-latest, triplet: x64-linux } | ||
- { os: windows-2022, triplet: x64-windows-static-vs2022 } | ||
- { os: macos-latest, triplet: x64-osx } | ||
|
||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- name: Install linux dependencies | ||
if: ${{ matrix.cfg.os == 'ubuntu-latest' }} | ||
run: sudo apt-get install nasm openssl ninja-build | ||
- name: Install osx dependencies | ||
if: ${{ matrix.cfg.os == 'macos-latest' }} | ||
run: brew install nasm ninja | ||
- name: Cache vcpkg binary | ||
id: cache-vcpkg-bin | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
deps/vcpkg/vcpkg | ||
deps/vcpkg/vcpkg.exe | ||
key: ${{ runner.os }}-${{ hashFiles('deps/vcpkg/bootstrap.cmake') }} | ||
- name: Cache vcpkg packages | ||
id: cache-vcpkg | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cache/vcpkg | ||
~/AppData/Local/vcpkg/archives | ||
key: ${{ runner.os }}-${{ matrix.cfg.triplet }}-${{ hashFiles('vcpkg.json', '.git/modules/deps/vcpkg/shallow') }} | ||
- name: Bootstrap the ports | ||
run: python bootstrap.py --triplet ${{ matrix.cfg.triplet }} --clean-after-build | ||
- name: Build the code | ||
run: python build.py --triplet ${{ matrix.cfg.triplet }} --no-avx2 --python-path '${{ steps.setup-python.outputs.python-path }}' --run-tests |
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,3 @@ | ||
[submodule "deps/vcpkg"] | ||
path = deps/vcpkg | ||
url = https://github.com/VITObelgium/vcpkg-ports.git |
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,45 @@ | ||
#!/usr/bin/env python3 | ||
import os | ||
import sys | ||
import sysconfig | ||
import argparse | ||
|
||
from deps.vcpkg.scripts.buildtools import vcpkg | ||
|
||
if __name__ == "__main__": | ||
try: | ||
parser = argparse.ArgumentParser( | ||
description="Bootstrap infra.", parents=[vcpkg.bootstrap_argparser()] | ||
) | ||
|
||
args = parser.parse_args() | ||
|
||
platform = sysconfig.get_platform() | ||
triplet = args.triplet | ||
if platform == "win-amd64": | ||
triplet = "x64-windows-static-vs2022" | ||
elif platform == "mingw": | ||
triplet = "x64-mingw" | ||
elif not triplet: | ||
triplet = vcpkg.prompt_for_triplet() | ||
|
||
extras = [] | ||
build_root = None | ||
packages_root = None | ||
|
||
if args.clean: | ||
vcpkg.clean(triplet=triplet) | ||
else: | ||
vcpkg.bootstrap( | ||
ports_dir=os.path.join(".", "deps"), | ||
triplet=triplet, | ||
additional_ports=extras, | ||
build_root=build_root, | ||
packages_root=packages_root, | ||
) | ||
except KeyboardInterrupt: | ||
print("\nInterrupted") | ||
sys.exit(-1) | ||
except RuntimeError as e: | ||
print(e) | ||
sys.exit(-1) |
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,97 @@ | ||
#!/usr/bin/env python3 | ||
import os | ||
import sys | ||
import sysconfig | ||
import platform | ||
import argparse | ||
|
||
from deps.vcpkg.scripts.buildtools import vcpkg | ||
|
||
if __name__ == "__main__": | ||
try: | ||
parser = argparse.ArgumentParser( | ||
description="Build infra.", parents=[vcpkg.build_argparser()] | ||
) | ||
parser.add_argument( | ||
"--ui", dest="ui_enabled", action="store_true", help="build the ui" | ||
) | ||
|
||
parser.add_argument( | ||
"--ci", | ||
dest="ci_build", | ||
action="store_true", | ||
help="continuous integration build", | ||
) | ||
|
||
parser.add_argument( | ||
"--build-config", | ||
dest="build_config", | ||
help="Build configuration (Debug or Release)", | ||
default="Release", | ||
) | ||
|
||
args = parser.parse_args() | ||
|
||
build_ui = ( | ||
"ON" | ||
if (platform.system() == "Windows" and not args.ci_build) or args.ui_enabled | ||
else "OFF" | ||
) | ||
sys_platform = sysconfig.get_platform() | ||
|
||
triplet = args.triplet | ||
if sys_platform == "win-amd64": | ||
triplet = "x64-windows-static-vs2022" | ||
elif sys_platform == "mingw": | ||
triplet = "x64-mingw" | ||
elif not triplet: | ||
triplet = vcpkg.prompt_for_triplet() | ||
|
||
cmake_args = [ | ||
f"-DINFRA_UI_COMPONENTS={build_ui}", | ||
"-DINFRA_LOGGING=ON", | ||
"-DINFRA_GDAL=ON", | ||
"-DINFRA_XML=ON", | ||
"-DINFRA_TBB=ON", | ||
"-DINFRA_NUMERIC=OFF", | ||
"-DINFRA_CHARSET=ON", | ||
"-DINFRA_PROCESS=ON", | ||
"-DINFRA_DATABASE=ON", | ||
"-DINFRA_DATABASE_SQLITE=ON", | ||
"-DINFRA_DATABASE_POSTGRES=ON", | ||
"-DINFRA_DATABASE_HASHING=ON", | ||
"-DINFRA_COMPRESSION=ON", | ||
"-DINFRA_COMPRESSION_ZSTD=ON", | ||
"-DINFRA_ENABLE_TESTS=ON", | ||
"-DINFRA_CLI_PROGRESS=ON", | ||
] | ||
|
||
if build_ui and triplet.startswith("x64-osx"): | ||
cmake_args.extend( | ||
[ | ||
"-DCMAKE_PREFIX_PATH=/usr/local/opt/qt6", | ||
"-DVCPKG_ALLOW_SYSTEM_LIBS=ON", | ||
] | ||
) | ||
|
||
targets = [] | ||
build_dir = "infra" | ||
install_root = "vcpkgs" | ||
|
||
vcpkg.build_project( | ||
os.path.abspath(args.source_dir), | ||
triplet=triplet, | ||
cmake_args=cmake_args, | ||
targets=targets, | ||
build_name=build_dir, | ||
run_tests_after_build=args.run_tests, | ||
test_arguments=args.test_args, | ||
build_config=args.build_config, | ||
install_root=install_root, | ||
) | ||
except KeyboardInterrupt: | ||
print("\nInterrupted") | ||
sys.exit(-1) | ||
except RuntimeError as e: | ||
print(e) | ||
sys.exit(-1) |
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,90 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", | ||
"name": "infra", | ||
"version": "0.11.2", | ||
"dependencies": [ | ||
"fmt", | ||
"doctest" | ||
], | ||
"features": { | ||
"log": { | ||
"description": "logging support", | ||
"dependencies": [ | ||
"spdlog" | ||
] | ||
}, | ||
"process": { | ||
"description": "process support", | ||
"dependencies": [ | ||
"reproc" | ||
] | ||
}, | ||
"hashing": { | ||
"description": "hashing support", | ||
"dependencies": [ | ||
"cryptopp" | ||
] | ||
}, | ||
"xml": { | ||
"description": "xml support", | ||
"dependencies": [ | ||
"tinyxml" | ||
] | ||
}, | ||
"tbb": { | ||
"description": "threading building blocks support", | ||
"dependencies": [ | ||
"tbb" | ||
] | ||
}, | ||
"numeric": { | ||
"description": "numeric support", | ||
"dependencies": [ | ||
"eigen3" | ||
] | ||
}, | ||
"charset": { | ||
"description": "charset conversion/detection support", | ||
"dependencies": [ | ||
"icu" | ||
] | ||
}, | ||
"compression": { | ||
"description": "compression support", | ||
"dependencies": [ | ||
"zstd" | ||
] | ||
}, | ||
"gdal": { | ||
"description": "gdal support", | ||
"dependencies": [ | ||
"gdal" | ||
] | ||
}, | ||
"db": { | ||
"description": "database support", | ||
"dependencies": [ | ||
{ | ||
"name": "hdf5", | ||
"features": [ | ||
"sqlite", | ||
"postgresql" | ||
] | ||
} | ||
] | ||
}, | ||
"cpp17": { | ||
"description": "C++17 build", | ||
"dependencies": [ | ||
"date", | ||
"gsl" | ||
] | ||
}, | ||
"ui": { | ||
"description": "ui support", | ||
"dependencies": [ | ||
"qt6" | ||
] | ||
} | ||
} | ||
} |