Skip to content
Merged
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
5 changes: 4 additions & 1 deletion .devcontainer/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ RUN apt-get install -y \
libgmp-dev \
libmpfr-dev

WORKDIR /workspace
RUN chown -R ubuntu:ubuntu /home/ubuntu

USER ubuntu
WORKDIR /home/ubuntu/dev
9 changes: 5 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@
"name": "Tessellator",
"dockerFile": "Dockerfile.base",
"context": "..",
"remoteUser": "root",
"workspaceFolder": "/workspace",
"remoteUser": "ubuntu",
"workspaceFolder": "/home/ubuntu/dev",
"mounts": [
"source=${localWorkspaceFolder},target=/workspace,type=bind",
"source=${localWorkspaceFolder},target=/home/ubuntu/dev,type=bind"
],
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cmake-tools",
"vadimcn.vscode-lldb"
"vadimcn.vscode-lldb",
"matepek.vscode-catch2-test-adapter"
],
"settings": {
"cmake.configureOnOpen": false,
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on:
branches:
- main

env:
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
WINDOWS_FILENAME: opensemba-tessellator-windows-x64.tar.gz
LINUX_FILENAME: opensemba-tessellator-linux.tar.gz

Expand All @@ -27,7 +28,7 @@ jobs:
strategy:
matrix:
preset: [
{"os": windows-latest, "name": "msbuild", "filename": "windows-x64"},
{"os": windows-2022, "name": "msbuild", "filename": "windows-x64"},
{"os": ubuntu-latest, "name": "gnu", "filename": "linux"}
]
build-type: ["Release"]
Expand Down Expand Up @@ -59,8 +60,17 @@ jobs:
sudo apt-get update
sudo apt-get install -y libvtk9-dev

- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');

- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: eed289f6e06a5e7a5c9e6a729671b0a56af7dd69

- name: Windows configure and build
if: matrix.preset.name=='msbuild'
Expand Down
19 changes: 14 additions & 5 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@ on:
branches:
- main
- dev

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"

jobs:
builds-and-tests:
strategy:
matrix:
preset: [
{"os": windows-latest, "name": "msbuild"},
{"os": windows-2022, "name": "msbuild"},
{"os": ubuntu-latest, "name": "gnu"}
]
build-type: ["Debug", "Release"]
Expand Down Expand Up @@ -45,8 +48,17 @@ jobs:
sudo apt-get update
sudo apt-get install -y libvtk9-dev

- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');

- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: eed289f6e06a5e7a5c9e6a729671b0a56af7dd69

- name: Windows configure and build
if: matrix.preset.name=='msbuild'
Expand All @@ -67,6 +79,3 @@ jobs:
- name: Ubuntu Run tests
if: matrix.preset.name=='gnu'
run: build/bin/tessellator_tests



4 changes: 3 additions & 1 deletion .vscode/settings.dev.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"cmake.configureOnOpen": false,
"cmake.configureOnEdit": false,
"cmake.autoSelectActiveFolder": false
"cmake.autoSelectActiveFolder": false,
"testMate.cpp.test.executables": "{build,build-dbg,Build,BUILD,out,Out,OUT}/**/*{test,Test,TEST}*",
"testMate.cpp.test.workingDirectory": "${workspaceFolder}"
}
125 changes: 72 additions & 53 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,56 +1,75 @@
{
"version": 4,
"configurePresets": [
{
"name": "default",
"hidden": true,
"binaryDir": "build/",
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": {
"type": "FILEPATH",
"value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
"version": 4,
"configurePresets": [
{
"name": "default",
"hidden": true,
"binaryDir": "build/",
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": {
"type": "FILEPATH",
"value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
}
}
},
{
"name": "msbuild",
"displayName": "MSBuild Configure Settings",
"generator": "Visual Studio 17 2022",
"architecture": {
"strategy": "set",
"value": "x64"
},
"inherits": "default"
},
{
"name": "gnu",
"displayName": "GNU g++ compiler",
"generator": "Ninja",
"inherits": "default"
},
{
"name": "docker",
"displayName": "Docker (system libraries)",
"description": "Uses system-installed libraries, skips vcpkg. Optimized for containerized builds.",
"generator": "Ninja",
"binaryDir": "build/",
"cacheVariables": {
"CMAKE_CXX_COMPILER": "g++",
"CMAKE_PREFIX_PATH": "/usr/local",
"CMAKE_FIND_ROOT_PATH": "/usr/local",
"TESSELLATOR_ENABLE_TESTS": "ON",
"TESSELLATOR_ENABLE_CGAL": "OFF"
}
},
{
"name": "docker-dbg",
"inherits": "docker",
"displayName": "Docker-dbg (system libraries)",
"description": "Uses system-installed libraries, skips vcpkg. Optimized for containerized builds. Debug mode",
"binaryDir": "build-dbg/",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_CXX_COMPILER": "g++",
"CMAKE_PREFIX_PATH": "/usr/local",
"CMAKE_FIND_ROOT_PATH": "/usr/local",
"TESSELLATOR_ENABLE_TESTS": "ON",
"TESSELLATOR_ENABLE_CGAL": "OFF"
}
}
}
},
{
"name": "msbuild",
"displayName": "MSBuild Configure Settings",
"generator": "Visual Studio 17 2022",
"architecture": {
"strategy": "set",
"value": "x64"
},
"inherits": "default"
},
{
"name": "gnu",
"displayName": "GNU g++ compiler",
"generator": "Ninja",
"inherits": "default"
},
{
"name": "docker",
"displayName": "Docker (system libraries)",
"description": "Uses system-installed libraries, skips vcpkg. Optimized for containerized builds.",
"generator": "Ninja",
"binaryDir": "build/",
"cacheVariables": {
"CMAKE_CXX_COMPILER": "g++",
"CMAKE_PREFIX_PATH": "/usr/local",
"CMAKE_FIND_ROOT_PATH": "/usr/local",
"TESSELLATOR_ENABLE_TESTS": "ON",
"TESSELLATOR_ENABLE_CGAL": "OFF"
}
}
],
"buildPresets": [
{
"name": "default",
"configurePreset": "default"
},
{
"name": "docker",
"configurePreset": "docker"
}
]
],
"buildPresets": [
{
"name": "default",
"configurePreset": "default"
},
{
"name": "docker",
"configurePreset": "docker"
},
{
"name": "docker-dbg",
"configurePreset": "docker-dbg"
}
]
}
12 changes: 12 additions & 0 deletions overlayPorts/libaec/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Original port: https://github.com/microsoft/vcpkg/tree/fedfb6ae868887a13f8a0ba3b29603bd7eb9f118/ports/libaec

A different download url is used to avoid connection errors.

libaec provides CMake targets:
``` Cmake
find_package(libaec CONFIG REQUIRED)
# libaec API
target_link_libraries(main PRIVATE libaec::aec)
# szip compatible API
target_link_libraries(main PRIVATE libaec::sz)
```
44 changes: 44 additions & 0 deletions overlayPorts/libaec/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Deutsches-Klimarechenzentrum/libaec
REF v${VERSION}
SHA512 76df7501d1b7d91a43b525ba828f092f18d83f8ab09a9331e5758f93942a9758ad580baca8f9316b92a98639bde2e23cacbc2f33f52d0dd98ce7efe412cf43cd
HEAD_REF master
)

string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_STATIC_LIBS=${BUILD_STATIC}
-Dlibaec_INSTALL_CMAKEDIR=share/${PORT}
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup()
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/libaec/libaec-config.cmake"
"if(libaec_USE_STATIC_LIBS)"
"if(\"${BUILD_STATIC}\") # forced by vcpkg"
)

# Compatibility with user's CMake < 3.18 (vcpkg claims support for >= 3.16):
# Make imported targets global so that libaec-config.cmake can create ALIAS targets.
set(_target_file "libaec_shared-targets")
if(BUILD_STATIC)
set(_target_file "libaec_static-targets")
endif()
file(READ "${CURRENT_PACKAGES_DIR}/share/libaec/${_target_file}.cmake" libaec_targets)
string(REGEX REPLACE " (SHARED|STATIC) IMPORTED" " \\1 IMPORTED \${libaec_maybe_global}" libaec_targets "${libaec_targets}")
file(WRITE "${CURRENT_PACKAGES_DIR}/share/libaec/${_target_file}.cmake" "set(libaec_maybe_global \"\")
if(CMAKE_VERSION VERSION_LESS 3.18)
set(libaec_maybe_global \"GLOBAL\")
endif()
${libaec_targets}
"
)

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

file(INSTALL "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
7 changes: 7 additions & 0 deletions overlayPorts/libaec/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
libaec provides CMake targets:

find_package(libaec CONFIG REQUIRED)
# libaec API
target_link_libraries(main PRIVATE libaec::aec)
# szip compatible API
target_link_libraries(main PRIVATE libaec::sz)
17 changes: 17 additions & 0 deletions overlayPorts/libaec/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "libaec",
"version": "1.1.6",
"description": "Adaptive Entropy Coding library",
"homepage": "https://gitlab.dkrz.de/k202009/libaec",
"license": "BSD-2-Clause",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
3 changes: 3 additions & 0 deletions vcpkg-configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@
"location": "https://aka.ms/vcpkg-ce-default",
"name": "microsoft"
}
],
"overlay-ports" : [
"./overlayPorts"
]
}
Loading