summaryrefslogtreecommitdiff
path: root/test cases/rust/20 rust and cpp/lib.cpp
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2023-06-22 11:43:35 -0700
committerDylan Baker <dylan@pnwbakers.com>2023-06-27 11:53:18 -0700
commit772cb926243e6c3506c48d4e636359f8de397135 (patch)
treea7463328b35010003de276b7ee0bbc3327522152 /test cases/rust/20 rust and cpp/lib.cpp
parent5d16bd5308f0edd9d53b82ff6a961241c7188423 (diff)
downloadmeson-772cb926243e6c3506c48d4e636359f8de397135.tar.gz
rust: get stdlib arguments for non-rust languages when linking
Otherwise we might not get things like libstdc++, which we need.
Diffstat (limited to 'test cases/rust/20 rust and cpp/lib.cpp')
-rw-r--r--test cases/rust/20 rust and cpp/lib.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/test cases/rust/20 rust and cpp/lib.cpp b/test cases/rust/20 rust and cpp/lib.cpp
new file mode 100644
index 000000000..b08f870e2
--- /dev/null
+++ b/test cases/rust/20 rust and cpp/lib.cpp
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: Apache-2.0
+// Copyright © 2023 Intel Corporation
+
+#include "lib.hpp"
+
+#include <string>
+
+namespace {
+
+uint64_t priv_length(const std::string & str) {
+ return str.length();
+}
+
+}
+
+extern "C" uint64_t lib_length(const char * str) {
+ return priv_length(str);
+}