Skip to content

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

Use the same `cc` extension for C++ files (#11881)

Alex Crichton33224b227bfc
diff --git a/crates/test-programs/artifacts/build.rs b/crates/test-programs/artifacts/build.rs
index 7b215aa1cc..f0e8d6262b 100644
--- a/crates/test-programs/artifacts/build.rs
+++ b/crates/test-programs/artifacts/build.rs
@@ -249,7 +249,7 @@ impl Artifacts {
let name = path.file_stem().unwrap().to_str().unwrap().to_owned();
match path.extension().and_then(|s| s.to_str()) {
// Compile C/C++ tests with clang
- Some("c") | Some("cpp") | Some("cc") => self.build_c_or_cpp_test(path, name, tests),
+ Some("c") | Some("cc") => self.build_c_or_cpp_test(path, name, tests),
// just a header, part of another test.
Some("h") => {}
diff --git a/crates/test-programs/src/bin/dwarf_codegen_optimized.cpp b/crates/test-programs/src/bin/dwarf_codegen_optimized.cc
similarity index 100%
rename from crates/test-programs/src/bin/dwarf_codegen_optimized.cpp
rename to crates/test-programs/src/bin/dwarf_codegen_optimized.cc
diff --git a/crates/test-programs/src/bin/dwarf_codegen_optimized_wasm_optimized.cpp b/crates/test-programs/src/bin/dwarf_codegen_optimized_wasm_optimized.cc
similarity index 100%
rename from crates/test-programs/src/bin/dwarf_codegen_optimized_wasm_optimized.cpp
rename to crates/test-programs/src/bin/dwarf_codegen_optimized_wasm_optimized.cc
diff --git a/crates/test-programs/src/bin/dwarf_generic.cpp b/crates/test-programs/src/bin/dwarf_generic.cc
similarity index 97%
rename from crates/test-programs/src/bin/dwarf_generic.cpp
rename to crates/test-programs/src/bin/dwarf_generic.cc
index 0cf14533bc..6daccbc790 100644
--- a/crates/test-programs/src/bin/dwarf_generic.cpp
+++ b/crates/test-programs/src/bin/dwarf_generic.cc
@@ -1,4 +1,4 @@
-//! extra-files = ['dwarf_generic_satellite.cpp']
+//! extra-files = ['dwarf_generic_satellite.cc']
// clang-format off
// clang -o generic.wasm -target wasm32-unknown-wasip1 -g generic.cpp generic-satellite.cpp
diff --git a/crates/test-programs/src/bin/dwarf_generic_satellite.cpp b/crates/test-programs/src/bin/dwarf_generic_satellite.cc
similarity index 100%
rename from crates/test-programs/src/bin/dwarf_generic_satellite.cpp
rename to crates/test-programs/src/bin/dwarf_generic_satellite.cc
diff --git a/docs/examples-async.md b/docs/examples-async.md
index 5bacc5c0a9..52c97fe5a7 100644
--- a/docs/examples-async.md
+++ b/docs/examples-async.md
@@ -3,7 +3,7 @@
You can also [browse this source code online][code] and clone the wasmtime
repository to run the example locally.
-[code]: https://github.com/bytecodealliance/wasmtime/blob/main/examples/async.cpp
+[code]: https://github.com/bytecodealliance/wasmtime/blob/main/examples/async.cc
This example demonstrates configuring Wasmtime for asynchronous operation and calling async host functions from wasm.
@@ -18,7 +18,7 @@ This example demonstrates configuring Wasmtime for asynchronous operation and ca
<!-- langtabs-start -->
```cpp
-{{#include ../examples/async.cpp}}
+{{#include ../examples/async.cc}}
```
<!-- langtabs-end -->
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index ee083133df..6857aa416b 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -63,7 +63,7 @@ create_rust_wasm(resource-component wasm32-wasip2)
# C/C++ examples/tests
create_target(anyref anyref.c)
create_target(anyref-cpp anyref.cc)
-create_target(async async.cpp)
+create_target(async async.cc)
create_target(externref externref.c)
create_target(externref-cpp externref.cc)
create_target(fib-debug fib-debug/main.c)
diff --git a/examples/async.cpp b/examples/async.cc
similarity index 99%
rename from examples/async.cpp
rename to examples/async.cc
index 523f327f96..cff6d6ad00 100644
--- a/examples/async.cpp
+++ b/examples/async.cc
@@ -5,7 +5,7 @@ function.
You can compile and run this example on Linux with:
cargo build --release -p wasmtime-c-api
- c++ examples/async.cpp \
+ c++ examples/async.cc \
-I crates/c-api/include \
target/release/libwasmtime.a \
-std=c++11 \
diff --git a/tests/all/native_debug/lldb.rs b/tests/all/native_debug/lldb.rs
index 92a41415cb..cc5b5c4ba9 100644
--- a/tests/all/native_debug/lldb.rs
+++ b/tests/all/native_debug/lldb.rs
@@ -262,8 +262,8 @@ pub fn dwarf_codegen_optimized() -> Result<()> {
],
r#"b InitializeTest
r
-b dwarf_codegen_optimized.cpp:25
-b dwarf_codegen_optimized.cpp:26
+b dwarf_codegen_optimized.cc:25
+b dwarf_codegen_optimized.cc:26
c
v x
c
@@ -297,8 +297,8 @@ pub fn dwarf_codegen_optimized_wasm_optimized() -> Result<()> {
],
r#"b InitializeTest
r
-b dwarf_codegen_optimized_wasm_optimized.cpp:23
-b dwarf_codegen_optimized_wasm_optimized.cpp:29
+b dwarf_codegen_optimized_wasm_optimized.cc:23
+b dwarf_codegen_optimized_wasm_optimized.cc:29
c
v b
c