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
75 changes: 0 additions & 75 deletions .github/actions/initialize-vcpkg/action.yml

This file was deleted.

13 changes: 9 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ jobs:
runs-on: ${{ matrix.os }}
env:
QT_VERSION: 6.11.2
VCPKG_REF: 39344dff01c5a5a0134caf2624cdd492f05d30ea
VCPKG_DISABLE_METRICS: '1'
INNOSETUP_REF: is-6_5_4
DSSP_CHANNEL: nightly
Expand Down Expand Up @@ -168,10 +167,13 @@ jobs:
"DSSP_DIRECTORY=$dsspDirectory" >> $env:GITHUB_ENV

- name: Initialize Vcpkg
uses: ./.github/actions/initialize-vcpkg
id: vcpkg
uses: stdware/dev-scripts/actions/vcpkg-workspace@main
env:
VCPKG_KEEP_ENV_VARS: VCPKG_BUILD_TYPE;MACOSX_DEPLOYMENT_TARGET
with:
ref: ${{ env.VCPKG_REF }}
use_cache: ${{ inputs.build_type != 'nightly' && inputs.use_cache }}
qt-dir: ${{ env.QT_ROOT_DIR }}
cache: ${{ inputs.build_type != 'nightly' && inputs.use_cache }}

- name: Restore CCache cache
if: inputs.build_type != 'nightly' && inputs.use_cache && inputs.use_ccache
Expand All @@ -185,6 +187,7 @@ jobs:
- name: Build
env:
DSPM_EXECUTABLE: ${{ steps.download_dspm.outputs.path }}
VCPKG_ROOT_DIR: ${{ steps.vcpkg.outputs.vcpkg-root }}
run: |
$expectedRunnerArch = $env:ARTIFACT_ARCH -eq 'amd64' ? 'X64' : 'ARM64'
if ($env:RUNNER_ARCH -ne $expectedRunnerArch) {
Expand Down Expand Up @@ -218,6 +221,8 @@ jobs:
key: ${{ runner.os }}-ccache-${{ inputs.source_sha }}

- name: Collect symbol files
env:
VCPKG_ROOT_DIR: ${{ steps.vcpkg.outputs.vcpkg-root }}
run: |
$output = & ./scripts/ci/Collect-Symbol-Files.ps1 `
-VcpkgRootDir $env:VCPKG_ROOT_DIR `
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ cache
.vs
out/
CMakeSettings.json
/vcpkg
/deps
/data
/*.natvis

Expand Down
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
path = src/libs/3rdparty/talcs
url = ../../CrSjimo/talcs.git

[submodule "vcpkg"]
path = scripts/vcpkg
url = ../../stdware/vcpkg-overlay.git

[submodule "opendspx"]
path = src/libs/3rdparty/opendspx
url = ../../diffscope/opendspx.git
Expand Down
9 changes: 5 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ DiffScope is a C++20/Qt 6 singing-voice editor. Keep `src/app` a thin launcher;
- `src/share/`: shared install/deployment rules used after ChorusKit finishes configuring the application.
- `src/libs/3rdparty/`: Git submodules. Treat these as upstream projects; do not mix ordinary feature changes with submodule edits.
- `src/libs/application/uishell/tests/`: standalone visual/smoke applications. `src/tests/` is reserved for application-wide tests.
- `scripts/vcpkg-manifest/` and `scripts/vcpkg/`: dependency manifest and overlay ports/triplets. `scripts/ci/` is the packaging reference. `dist/` contains installers.
- `scripts/vcpkg-manifest/`: dependency manifest. `scripts/vcpkg-sources.json` specifies the repositories and refs of vcpkg and of the overlays, which `scripts/vcpkg-workspace.cmake` checks out into the ignored directory `deps/`. The ignored file `scripts/vcpkg-sources.local.json` takes precedence over it, for example to use a local overlay through `"path"`. `scripts/ci/` is the packaging reference. `dist/` contains installers.

Never commit generated files from `build/`, `cmake-build-*`, `out/`, `.qm`, MOC, QML cache, or synchronized include directories.

Expand Down Expand Up @@ -215,15 +215,16 @@ View-model bindings maintain explicit document-to-view and view-to-document maps

## Configure, Build, and Run

Use a recursive checkout, CMake 3.19+, Qt 6.10-compatible development packages, Ninja, and a C++20 compiler. During vcpkg installation, expose the Qt CMake directory through `QT_DIR`/`Qt6_DIR` and retain those variables for overlay ports.
Use a recursive checkout, CMake 3.19+, Qt 6.10-compatible development packages, Ninja, and a C++20 compiler. `scripts/vcpkg-workspace.cmake`, which is downloaded from https://github.com/stdware/dev-scripts and ignored by git, prepares vcpkg, the overlays, and the dependencies in `deps/`, and passes the Qt CMake directory to the ports that build against Qt. `cmake -P scripts/vcpkg-workspace.cmake help` lists its commands, and `--dry-run` prints the commands without running them. The configuration requires `CMAKE_TOOLCHAIN_FILE`, the toolchain of `deps/vcpkg`.

Do not perform any test, build, run, or automatic formatting operations unless explicitly requested by the user. Also do not include any of these operations in the plan unless explicitly requested by the user.

```sh
git submodule update --init --recursive
<vcpkg>/vcpkg install --x-manifest-root=scripts/vcpkg-manifest --x-install-root=<vcpkg>/installed --triplet=<triplet>
curl -fsSL -o scripts/vcpkg-workspace.cmake https://raw.githubusercontent.com/stdware/dev-scripts/main/scripts/vcpkg-workspace.cmake
cmake -P scripts/vcpkg-workspace.cmake install --qt-dir <qt>/lib/cmake/Qt6 --triplet <triplet>
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_TOOLCHAIN_FILE=<vcpkg>/scripts/buildsystems/vcpkg.cmake \
-DCMAKE_TOOLCHAIN_FILE=deps/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DQt6_DIR=<qt>/lib/cmake/Qt6 -DAPPLICATION_BUILD_TESTS=ON \
-DTALCS_DSPX=ON -DTALCS_WIDGETS=ON
cmake --build build --parallel
Expand Down
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ else()
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)
endif()

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

# Sets the cache entry APPLICATION_TRIPLET, the triplet of the build such as x86_64-windows-msvc
include(DetectTriplet)

if(APPLICATION_INSTALL)
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
Expand Down
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,26 @@ If you are interested in contributing or collaborating, please feel free to reac
git clone --recursive https://github.com/diffscope/diffscope-project.git
```

3. Install dependencies via Vcpkg.
3. Install dependencies via Vcpkg with [vcpkg-workspace.cmake](https://github.com/stdware/dev-scripts/blob/main/docs/about-scripts/vcpkg-workspace.md), downloaded into `scripts/`. The script checks out vcpkg and the overlays that `scripts/vcpkg-sources.json` specifies into `deps/`, and installs the dependencies there. It runs on Windows, macOS and Linux.

```bash
vcpkg install --x-manifest-root=/path/to/diffscope-project/scripts/vcpkg-manifest --x-install-root=/path/to/vcpkg/installed
curl -fsSL -o scripts/vcpkg-workspace.cmake https://raw.githubusercontent.com/stdware/dev-scripts/main/scripts/vcpkg-workspace.cmake
cmake -P scripts/vcpkg-workspace.cmake install --qt-dir /path/to/Qt/lib/cmake/Qt6
```

On Windows, the script is downloaded in PowerShell or in cmd with

```bat
powershell -Command "Invoke-WebRequest -OutFile scripts/vcpkg-workspace.cmake https://raw.githubusercontent.com/stdware/dev-scripts/main/scripts/vcpkg-workspace.cmake"
```

`cmake -P scripts/vcpkg-workspace.cmake help` lists the other commands. `--dry-run` prints the commands without running them. `scripts/vcpkg-sources.local.json` takes precedence over `scripts/vcpkg-sources.json`, for example to use a local overlay.

4. Build using CMake.
4. Build using CMake with the vcpkg toolchain in `deps/`.

```bash
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=deps/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_PREFIX_PATH=/path/to/Qt
```

You may refer to CI scripts for more details.

Expand Down
46 changes: 46 additions & 0 deletions cmake/DetectTriplet.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# SPDX-FileCopyrightText: Team OpenVPI
# SPDX-License-Identifier: Apache-2.0

# The triplet of the build, <architecture>-<system>-<ABI>, such as x86_64-windows-msvc, which the
# about dialog shows as the target platform. The naming follows HelloUtau.
#
# The names are those that users know rather than those of vcpkg: x86_64 for the architecture
# rather than x64, a name of Microsoft, arm64 as Apple names the architecture, and mac for the
# system rather than osx.
# The ABI rather than the compiler is named, because a build of clang for the MSVC ABI loads the
# plugins of a build of MSVC.
#
# Sets the cache entry APPLICATION_TRIPLET, which -DAPPLICATION_TRIPLET=<triplet> overrides.

if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(AMD64|x86_64|x64)$")
set(_application_arch x86_64)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(ARM64|aarch64|arm64)$")
set(_application_arch arm64)
else()
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" _application_arch)
endif()

if(WIN32)
set(_application_system windows)
elseif(APPLE)
set(_application_system mac)
else()
set(_application_system linux)
endif()

if(MSVC OR CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
set(_application_abi msvc)
elseif(MINGW)
set(_application_abi mingw)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(_application_abi gcc)
else()
string(TOLOWER "${CMAKE_CXX_COMPILER_ID}" _application_abi)
endif()

set(APPLICATION_TRIPLET "${_application_arch}-${_application_system}-${_application_abi}" CACHE STRING
"The triplet of the build, which the about dialog shows")

unset(_application_arch)
unset(_application_system)
unset(_application_abi)
7 changes: 7 additions & 0 deletions scripts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# SPDX-FileCopyrightText: Team OpenVPI
# SPDX-License-Identifier: Apache-2.0

# vcpkg-workspace.cmake from https://github.com/stdware/dev-scripts, downloaded before use, and its
# local sources, which take precedence over vcpkg-sources.json
/vcpkg-workspace.cmake
/vcpkg-sources.local.json
1 change: 0 additions & 1 deletion scripts/vcpkg
Submodule vcpkg deleted from 7acffe
10 changes: 1 addition & 9 deletions scripts/vcpkg-manifest/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,5 @@
"xxhash",
"signalsmith-dsp",
"rubberband"
],
"vcpkg-configuration": {
"overlay-ports": [
"../vcpkg/ports"
],
"overlay-triplets": [
"../vcpkg/triplets"
]
}
]
}
20 changes: 20 additions & 0 deletions scripts/vcpkg-sources.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"manifest-dir": "vcpkg-manifest",
"vcpkg": {
"repository": "https://github.com/microsoft/vcpkg.git",
"ref": "master"
},
"overlays": [
{
"repository": "../../stdware/vcpkg-overlay.git",
"ref": "main"
}
],
"tasks": {
"list": [
"${VCPKG_EXECUTABLE}",
"list",
"--x-install-root=${VCPKG_INSTALLED_DIR}"
]
}
}
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ qm_add_definition(APPLICATION_DISPLAY_NAME ${APPLICATION_DISPLAY_NAME} STRING_LI
qm_add_definition(APPLICATION_VERSION ${APPLICATION_VERSION} STRING_LITERAL)
qm_add_definition(APPLICATION_ORG_NAME "OpenVPI" STRING_LITERAL)
qm_add_definition(APPLICATION_SEMVER ${APPLICATION_SEMVER} STRING_LITERAL)
qm_add_definition(APPLICATION_TRIPLET ${APPLICATION_TRIPLET} STRING_LITERAL)
qm_add_definition(APPLICATION_VENDOR_NAME ${APPLICATION_VENDOR_NAME} STRING_LITERAL)
qm_add_definition(APPLICATION_DEV_START_YEAR ${APPLICATION_DEV_START_YEAR} STRING_LITERAL)
qm_add_definition(APPLICATION_URL ${APPLICATION_URL} STRING_LITERAL)
Expand Down
6 changes: 4 additions & 2 deletions src/plugins/coreplugin/core/CoreInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,14 +295,16 @@ namespace Core {
"Branch: %1<br>"
"Commit: %2<br>"
"Build date: %3<br>"
"Toolchain: %4 %5 %6"
"Toolchain: %4 %5 %6<br>"
"Target platform: %7"
"</p>")
.arg(QStringLiteral(APPLICATION_GIT_BRANCH), //
QStringLiteral(APPLICATION_GIT_LAST_COMMIT_HASH), //
QLocale().toString(QDateTime::fromString(QStringLiteral(APPLICATION_BUILD_TIME), Qt::ISODate).toLocalTime()), //
QStringLiteral(APPLICATION_COMPILER_ARCH), //
QStringLiteral(APPLICATION_COMPILER_ID), //
QStringLiteral(APPLICATION_COMPILER_VERSION));
QStringLiteral(APPLICATION_COMPILER_VERSION), //
QStringLiteral(APPLICATION_TRIPLET));

QQmlComponent component(RuntimeInterface::qmlEngine(), "SVSCraft.UIComponents", "MessageBoxDialog");
if (component.isError()) {
Expand Down
Loading