From 76defac46243b96cb36524b1f4103c6a24f74a03 Mon Sep 17 00:00:00 2001 From: lyken Date: Sun, 7 Jul 2024 20:03:34 +0800 Subject: [PATCH] meta: use clang -x c++ instead of clang++ --- flake.nix | 2 +- nac3core/build.rs | 3 ++- nix/windows/default.nix | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index eba0432e..4febca24 100644 --- a/flake.nix +++ b/flake.nix @@ -12,7 +12,7 @@ llvm-tools-irrt = pkgs.runCommandNoCC "llvm-tools-irrt" {} '' mkdir -p $out/bin - ln -s ${pkgs.llvmPackages_14.clang-unwrapped}/bin/clang++ $out/bin/clang++-irrt + ln -s ${pkgs.llvmPackages_14.clang-unwrapped}/bin/clang $out/bin/clang-irrt ln -s ${pkgs.llvmPackages_14.llvm.out}/bin/llvm-as $out/bin/llvm-as-irrt ''; nac3artiq = pkgs.python3Packages.toPythonModule ( diff --git a/nac3core/build.rs b/nac3core/build.rs index 49edfad4..345c9046 100644 --- a/nac3core/build.rs +++ b/nac3core/build.rs @@ -17,6 +17,7 @@ fn main() { let flags: &[&str] = &[ "--target=wasm32", FILE, + "-x", "c++", "-fno-discard-value-names", "-fno-exceptions", "-fno-rtti", @@ -37,7 +38,7 @@ fn main() { let out_dir = env::var("OUT_DIR").unwrap(); let out_path = Path::new(&out_dir); - let output = Command::new("clang++-irrt") + let output = Command::new("clang-irrt") .args(flags) .output() .map(|o| { diff --git a/nix/windows/default.nix b/nix/windows/default.nix index 45554eab..c7709fd6 100644 --- a/nix/windows/default.nix +++ b/nix/windows/default.nix @@ -80,7 +80,7 @@ in rec { llvm-tools-irrt = pkgs.runCommandNoCC "llvm-tools-irrt" {} '' mkdir -p $out/bin - ln -s ${llvm-nac3}/bin/clang++.exe $out/bin/clang++-irrt.exe + ln -s ${llvm-nac3}/bin/clang.exe $out/bin/clang-irrt.exe ln -s ${llvm-nac3}/bin/llvm-as.exe $out/bin/llvm-as-irrt.exe ''; nac3artiq = pkgs.rustPlatform.buildRustPackage {