Skip to content

Commit c0203cd

Browse files
authored
fix: force clang to compile in c++ (#97)
1 parent 133a845 commit c0203cd

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

ecsact/cli/commands/build/cc_compiler_config.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ auto ecsact::cli::get_compiler_type_by_path( //
2222
if(compiler_filename == "clang") {
2323
return ecsact::cli::cc_compiler_type::clang;
2424
}
25+
26+
if(compiler_filename == "clang++") {
27+
return ecsact::cli::cc_compiler_type::clang;
28+
}
29+
2530
if(compiler_filename == "gcc") {
2631
return ecsact::cli::cc_compiler_type::gcc;
2732
}

ecsact/cli/commands/build/recipe/cook.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,9 @@ auto clang_gcc_compile(compile_options options) -> int {
357357
auto compile_proc_args = std::vector<std::string>{};
358358

359359
compile_proc_args.push_back("-c");
360+
compile_proc_args.push_back("-x");
361+
compile_proc_args.push_back("c++");
362+
360363
#if !defined(_WIN32)
361364
compile_proc_args.push_back("-fPIC");
362365
#endif

test/MODULE.bazel.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/build_recipe/BUILD.bazel

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
load("@bazel_skylib//rules:native_binary.bzl", "native_test")
21
load("@ecsact_cli//bazel:copts.bzl", "copts")
3-
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
4-
load("@rules_ecsact//ecsact:defs.bzl", "ecsact_binary", "ecsact_build_recipe")
2+
load("@rules_cc//cc:defs.bzl", "cc_test")
53

64
cc_test(
75
name = "test_build_recipe",
@@ -10,8 +8,8 @@ cc_test(
108
data = [
119
"ecsact_build_test.cc",
1210
"ecsact_build_test_merge.cc",
13-
"test-recipe.yml",
1411
"test-merge-recipe.yml",
12+
"test-recipe.yml",
1513
"//:test.ecsact",
1614
"//:test_codegen_plugin",
1715
"@ecsact_cli",
@@ -21,7 +19,6 @@ cc_test(
2119
"@llvm_toolchain_llvm//:bin/clang",
2220
],
2321
}),
24-
tags = ["no-sandbox"],
2522
env = select({
2623
"@platforms//os:windows": {
2724
"TEST_ECSACT_CLI": "$(rootpath @ecsact_cli)",
@@ -57,6 +54,7 @@ cc_test(
5754
],
5855
"//conditions:default": [],
5956
}),
57+
tags = ["no-sandbox"],
6058
deps = [
6159
"@ecsact_cli//ecsact/cli/commands:build",
6260
"@googletest//:gtest",
@@ -71,8 +69,8 @@ cc_test(
7169
data = [
7270
"ecsact_build_test.cc",
7371
"ecsact_build_test_merge.cc",
74-
"test-recipe.yml",
7572
"test-merge-recipe.yml",
73+
"test-recipe.yml",
7674
"//:test.ecsact",
7775
"//:test_codegen_plugin",
7876
"@ecsact_cli",
@@ -82,7 +80,6 @@ cc_test(
8280
"@llvm_toolchain_llvm//:bin/clang",
8381
],
8482
}),
85-
tags = ["no-sandbox"],
8683
env = select({
8784
"@platforms//os:windows": {
8885
"TEST_ECSACT_CLI": "$(rootpath @ecsact_cli)",
@@ -118,6 +115,7 @@ cc_test(
118115
],
119116
"//conditions:default": [],
120117
}),
118+
tags = ["no-sandbox"],
121119
deps = [
122120
"@ecsact_cli//ecsact/cli/commands:build",
123121
"@ecsact_cli//ecsact/cli/commands:recipe-bundle",

0 commit comments

Comments
 (0)