Skip to content

Commit 9d52d14

Browse files
authored
Merge pull request #14 from feltech/work/fixCToCppLinkage
[Build] Fix GCC C++ linkage
2 parents 2e3495d + 7ada935 commit 9d52d14

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@ if (OPENASSETIOTEST_ENABLE_C)
142142
add_executable(test.c.core src/test.core.c)
143143
add_test(c.core test.c.core)
144144
target_link_libraries(test.c.core PRIVATE OpenAssetIO::openassetio-core-c)
145+
# Must use C++ linker settings or the C++ standard library might not
146+
# be linked. This is required since openassetio-core-c depends on
147+
# openassetio-core, which is a C++ library.
148+
set_target_properties(test.c.core PROPERTIES LINKER_LANGUAGE CXX)
145149
target_compile_features(test.c.core PRIVATE c_std_99)
146150
if (WIN32 AND DEFINED OpenAssetIO_BINARY_DIR)
147151
set_tests_properties(c.core PROPERTIES ENVIRONMENT "PATH=${OpenAssetIO_BINARY_DIR_NATIVE}")

RELEASE_NOTES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ v1.0.0-alpha.x
1717
* CI testing added to exercise convergent dependency acquisition modes.
1818
[#7](https://github.com/OpenAssetIO/OpenAssetIO-Test-CMake/pull/7)
1919

20+
### Bug Fixes
21+
22+
* Updated build configuration such that C API tests use the C++ linker,
23+
fixing issues where the C++ standard library is not found on the
24+
default C linker search paths.
25+
[#14](https://github.com/OpenAssetIO/OpenAssetIO-Test-CMake/pull/14)
2026

2127
v1.0.0-alpha.1
2228
--------------

0 commit comments

Comments
 (0)