Skip to content

Commit 86324cf

Browse files
committed
fix vcpkg
1 parent 350f276 commit 86324cf

3 files changed

Lines changed: 27 additions & 6 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
with:
3030
submodules: recursive
3131

32-
- name: Install vcpkg
32+
- name: Set up vcpkg
3333
uses: lukka/run-vcpkg@v11
3434
with:
3535
vcpkgJsonGlob: scripts/vcpkg-manifest/vcpkg.json
@@ -47,21 +47,26 @@ jobs:
4747
run: |
4848
set(ws [=[${{ github.workspace }}]=])
4949
file(TO_CMAKE_PATH "${ws}" ws)
50+
set(CMAKE_BINARY_DIR "${ws}/build")
5051
include(${ws}/scripts/setup-onnxruntime.cmake)
5152
5253
- name: Configure CMake
54+
shell: bash
5355
run: |
5456
cmake -B build -S . \
5557
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
5658
-DSYNTHRT_BUILD_TESTS=ON \
5759
-DSYNTHRT_ORT_DIR=${{ github.workspace }}/build/onnxruntime \
58-
-DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake \
59-
-DVCPKG_OVERLAY_PORTS=${{ github.workspace }}/scripts/vcpkg/ports
60+
-DCMAKE_TOOLCHAIN_FILE="${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" \
61+
-DVCPKG_MANIFEST_DIR=${{ github.workspace }}/scripts/vcpkg-manifest \
62+
-DVCPKG_OVERLAY_PORTS=${{ github.workspace }}/scripts/vcpkg/ports \
63+
-DVCPKG_OVERLAY_TRIPLETS=${{ github.workspace }}/scripts/vcpkg/triplets
6064
6165
- name: Build
6266
run: cmake --build build --config ${{ env.BUILD_TYPE }} --parallel
6367

6468
- name: Test
69+
shell: bash
6570
run: |
6671
ctest --test-dir build --build-config ${{ env.BUILD_TYPE }} \
6772
--output-on-failure --parallel 4 --timeout 300

‎lib/G2P/Core/PackageManager.cpp‎

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <stdcorelib/pimpl.h>
1212
#include <stdcorelib/str.h>
1313

14+
#include <synthrt/G2P/Base/LangCommon.h>
1415
#include <synthrt/G2P/Package/Package.h>
1516
#include <synthrt/G2P/Support/ContextUtils.h>
1617
#include <synthrt/G2P/Support/Error.h>
@@ -76,6 +77,20 @@ namespace srt::g2p {
7677
const srt::core::JsonValue &config) const override;
7778
};
7879

80+
/// Concrete ModuleCategory for the "driver" category.
81+
/// Hosts register G2P driver factories (e.g. g2pOnnxDriver) here via
82+
/// addObject() before Manager::initialize(). Drivers are registered
83+
/// programmatically, not parsed from package.json, so parseSpec uses
84+
/// the default NotImplemented behavior.
85+
class DriverCategory : public srt::core::ModuleCategory {
86+
public:
87+
explicit DriverCategory(void *mgr)
88+
: srt::core::ModuleCategory(kDriverCategory, mgr) {}
89+
90+
std::string key() const override { return kDriverCategory; }
91+
std::string category() const override { return kDriverCategory; }
92+
};
93+
7994
/// Load a config file referenced by "configuration" in a module entry.
8095
/// Returns the inner "configuration" sub-object and updates apiLevel.
8196
/// This is a free helper (no friend access needed - only uses public JSON API).
@@ -216,8 +231,9 @@ namespace srt::g2p {
216231
} // namespace
217232

218233
PackageManager::Impl::Impl(PackageManager *decl) : decl(decl) {
219-
categories["g2p"] = new G2pCategory(decl);
220-
categories["dict"] = new DictCategory(decl);
234+
categories[kG2pCategory] = new G2pCategory(decl);
235+
categories[kDictCategory] = new DictCategory(decl);
236+
categories[kDriverCategory] = new DriverCategory(decl);
221237
}
222238

223239
PackageManager::Impl::~Impl() {

‎scripts/vcpkg-manifest/vcpkg.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
]
2020
}
2121
},
22-
"vcpkg-configuration": {
22+
"configuration": {
2323
"overlay-ports": [
2424
"../vcpkg/ports"
2525
],

0 commit comments

Comments
 (0)