Skip to content

Commit 7bdacb2

Browse files
committed
Fix static plugin CI linkage
1 parent ff80636 commit 7bdacb2

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,4 +214,6 @@ jobs:
214214
215215
- name: Test
216216
shell: msys2 {0}
217-
run: ctest --test-dir build --output-on-failure --no-tests=error
217+
run: |
218+
export PATH="$(cygpath -u "$RUNNER_TEMP")/stdcorelib/bin:$PATH"
219+
ctest --test-dir build --output-on-failure --no-tests=error

‎include/stdcorelib/plugin/plugin.h‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ namespace stdc::plugin {
6666

6767
}
6868

69-
#if !defined(STDC_PLUGIN_LIBRARY)
69+
#if !defined(STDC_PLUGIN_LIBRARY) && defined(_MSC_VER)
70+
// MSVC needs the dllimport declaration when inline registry code references the
71+
// exported _head and _tail data members. GNU-family compilers must instantiate
72+
// AddFactory locally because an outer explicit instantiation does not instantiate
73+
// the nested class.
7074
extern template class STDC_PLUGIN_EXPORT stdc::StaticRegistry<stdc::plugin::StaticPlugin>;
7175
#endif
7276

0 commit comments

Comments
 (0)