Skip to content

Commit 09b6fbe

Browse files
committed
fix vcpkg
1 parent 5c532f2 commit 09b6fbe

14 files changed

Lines changed: 111 additions & 19 deletions

‎.github/workflows/build.yml‎

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,23 @@ jobs:
2929
with:
3030
submodules: recursive
3131

32+
- name: Prepare vcpkg overlay ports
33+
shell: bash
34+
run: |
35+
git clone --depth 1 https://github.com/diffscope/ds-editor-lite.git /tmp/ds-editor-lite
36+
mkdir -p scripts/vcpkg/ports scripts/vcpkg/triplets
37+
cp -r /tmp/ds-editor-lite/scripts/vcpkg/ports/. scripts/vcpkg/ports/
38+
cp -r /tmp/ds-editor-lite/scripts/vcpkg/triplets/. scripts/vcpkg/triplets/
39+
3240
- name: Install vcpkg
3341
uses: lukka/run-vcpkg@v11
3442
with:
3543
vcpkgJsonGlob: scripts/vcpkg-manifest/vcpkg.json
3644

37-
- name: Setup LuaJIT (Windows)
38-
if: matrix.os == 'Windows'
39-
run: vcpkg install luajit --triplet x64-windows
40-
41-
- name: Setup LuaJIT (Linux)
42-
if: matrix.os == 'Linux'
43-
run: sudo apt-get update && sudo apt-get install -y libluajit-5.1-dev
44-
45-
- name: Setup LuaJIT (macOS)
46-
if: matrix.os == 'macOS'
47-
run: brew install luajit
48-
4945
- name: Download ONNX Runtime
5046
shell: cmake -P {0}
5147
run: |
52-
set(ws ${{ github.workspace }})
48+
set(ws [=[${{ github.workspace }}]=])
5349
file(TO_CMAKE_PATH "${ws}" ws)
5450
include(${ws}/scripts/setup-onnxruntime.cmake)
5551
@@ -58,6 +54,7 @@ jobs:
5854
cmake -B build -S . \
5955
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
6056
-DSYNTHRT_BUILD_TESTS=OFF \
57+
-DSYNTHRT_ORT_DIR=${{ github.workspace }}/build/onnxruntime \
6158
-DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake
6259
6360
- name: Build

‎CMakeLists.txt‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,13 @@ if(SYNTHRT_INSTALL)
158158
"${CMAKE_CURRENT_BINARY_DIR}/synthrtConfigVersion.cmake"
159159
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/synthrt
160160
)
161+
162+
# Install official G2P packages (Phonetic-Suite-*) required by LanguageService
163+
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests/common/G2pPackages")
164+
install(DIRECTORY tests/common/G2pPackages
165+
DESTINATION ${CMAKE_INSTALL_DATADIR}/synthrt
166+
)
167+
endif()
161168
endif()
162169

163170
if(SYNTHRT_BUILD_TESTS)

‎cmake/synthrtConfig.cmake.in‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77

88
include(CMakeFindDependencyMacro)
99

10-
# Find all sub-package configs exported by qm_add_library
10+
# Find all sub-package configs
1111
find_dependency(srt-core)
1212
find_dependency(srt-driver)
13+
find_dependency(srt-s2p)
14+
find_dependency(srt-svs)
1315
find_dependency(srt-g2p)
1416
find_dependency(srt-ds-bank)
15-
find_dependency(srt-ds-infer)
17+
find_dependency(dsinfer)
1618

1719
include("${CMAKE_CURRENT_LIST_DIR}/synthrtTargets.cmake")
1820

‎domains/ds-bank/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ project(dsbank
99
# ----------------------------------
1010
set(DSBANK_INSTALL ${SYNTHRT_INSTALL})
1111
set(DSBANK_VERSION ${PROJECT_VERSION})
12-
set(DSBANK_INSTALL_NAME ${PROJECT_NAME})
12+
set(DSBANK_INSTALL_NAME srt-ds-bank)
1313

1414
# ----------------------------------
1515
# Configure BuildAPI
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@PACKAGE_INIT@
2+
3+
include(CMakeFindDependencyMacro)
4+
find_dependency(stdcorelib)
5+
find_dependency(srt-core)
6+
7+
include("${CMAKE_CURRENT_LIST_DIR}/srt-ds-bankTargets.cmake")
8+
9+
check_required_components(srt-ds-bank)

‎domains/ds-infer/lib/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ dsinfer_add_library(srt-ds-infer SHARED PREFIX dsinfer
3030
target_compile_definitions(srt-ds-infer PRIVATE DSINFER_LIBRARY)
3131

3232
find_path(SPARSEPP_INCLUDE_DIRS "sparsepp/spp.h")
33-
# Expose include/diffsinger/Infer/ as PUBLIC so consumers (ds-session, CLI) can
33+
# Expose include/diffsinger/Infer/ as PUBLIC so consumers (CLI, lite) can
3434
# resolve <dsinfer/...> headers transitively included by public headers such as
3535
# InferenceRequest.h -> CommonApiL1.h -> <dsinfer/Core/ParamTag.h>.
3636
target_include_directories(srt-ds-infer PUBLIC

‎lib/C/srt-cConfig.cmake.in‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@PACKAGE_INIT@
2+
3+
include(CMakeFindDependencyMacro)
4+
find_dependency(stdcorelib)
5+
find_dependency(srt-core)
6+
find_dependency(srt-ds-bank)
7+
find_dependency(srt-g2p)
8+
find_dependency(srt-driver)
9+
find_dependency(dsinfer)
10+
11+
include("${CMAKE_CURRENT_LIST_DIR}/srt-cTargets.cmake")
12+
13+
check_required_components(srt-c)

‎lib/Core/srt-coreConfig.cmake.in‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@PACKAGE_INIT@
2+
3+
include(CMakeFindDependencyMacro)
4+
find_dependency(stdcorelib)
5+
find_dependency(nlohmann_json)
6+
7+
include("${CMAKE_CURRENT_LIST_DIR}/srt-coreTargets.cmake")
8+
9+
check_required_components(srt-core)

‎lib/Driver/CMakeLists.txt‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,16 @@ find_package(stdcorelib CONFIG REQUIRED)
2424
# With ORT_API_MANUAL_INIT the C++ wrapper is header-only; no onnxruntime
2525
# library link is required (the shared library is loaded at runtime by the
2626
# OnnxDriver plugin).
27-
set(_onnxruntime_dir ${SYNTHRT_SOURCE_DIR}/third-party/onnxruntime)
27+
# Locate ONNX Runtime: check SYNTHRT_ORT_DIR (CI), then third-party/ (local), then build dir
28+
if(DEFINED SYNTHRT_ORT_DIR AND IS_DIRECTORY "${SYNTHRT_ORT_DIR}/default")
29+
set(_onnxruntime_dir ${SYNTHRT_ORT_DIR})
30+
elseif(IS_DIRECTORY ${SYNTHRT_SOURCE_DIR}/third-party/onnxruntime/default)
31+
set(_onnxruntime_dir ${SYNTHRT_SOURCE_DIR}/third-party/onnxruntime)
32+
elseif(IS_DIRECTORY ${CMAKE_BINARY_DIR}/onnxruntime/default)
33+
set(_onnxruntime_dir ${CMAKE_BINARY_DIR}/onnxruntime)
34+
else()
35+
set(_onnxruntime_dir ${SYNTHRT_SOURCE_DIR}/third-party/onnxruntime)
36+
endif()
2837
set(_onnxruntime_default_dir ${_onnxruntime_dir}/default)
2938

3039
set(_onnx_include_dirs "")
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@PACKAGE_INIT@
2+
3+
include(CMakeFindDependencyMacro)
4+
find_dependency(stdcorelib)
5+
find_dependency(srt-core)
6+
7+
include("${CMAKE_CURRENT_LIST_DIR}/srt-driverTargets.cmake")
8+
9+
check_required_components(srt-driver)

0 commit comments

Comments
 (0)