downgrade glibc to 2.19 and update README
This commit is contained in:
31
test/BUILD
31
test/BUILD
@@ -1,15 +1,26 @@
|
||||
cc_binary(
|
||||
name = "hello",
|
||||
srcs = ["hello.cpp"],
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "go_lib",
|
||||
srcs = ["hello.go"],
|
||||
cgo = True,
|
||||
importpath = "github.com/motiejus/bazel-zig-cc/test",
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "gognu",
|
||||
embed = [":go_lib"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "gomusl",
|
||||
embed = [":go_lib"],
|
||||
static = "on",
|
||||
target_compatible_with = select({
|
||||
"@platforms//os:linux": ["@com_github_ziglang_zig//:musl"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
cc_binary(
|
||||
name = "exception",
|
||||
srcs = ["exception.cpp"],
|
||||
)
|
||||
|
||||
# go build -ldflags "-linkmode external -extldflags -static" hello.go
|
||||
|
||||
13
test/c/BUILD
13
test/c/BUILD
@@ -1,13 +0,0 @@
|
||||
cc_binary(
|
||||
name = "hello",
|
||||
srcs = ["hello.cpp"],
|
||||
target_compatible_with = select({
|
||||
"@platforms//os:linux": ["@com_github_ziglang_zig//:musl"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
)
|
||||
|
||||
cc_binary(
|
||||
name = "exception",
|
||||
srcs = ["exception.cpp"],
|
||||
)
|
||||
@@ -1,12 +0,0 @@
|
||||
#include <iostream>
|
||||
|
||||
int main() {
|
||||
std::cerr << "will throw and expect to catch an error..." << std::endl;
|
||||
|
||||
try {
|
||||
throw "error";
|
||||
} catch (const char* msg) {
|
||||
std::cerr << "caught: " << msg << std::endl;
|
||||
}
|
||||
std::cerr << "done" << std::endl;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
#include <iostream>
|
||||
|
||||
int main() {
|
||||
std::cout << "Hello World!" << std::endl;
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||||
|
||||
# go build -ldflags "-linkmode external -extldflags -static" hello.go
|
||||
go_library(
|
||||
name = "go_lib",
|
||||
srcs = ["hello.go"],
|
||||
cgo = True,
|
||||
importpath = "github.com/motiejus/bazel-zig-cc/test/go",
|
||||
visibility = ["//visibility:private"],
|
||||
target_compatible_with = select({
|
||||
"@platforms//os:linux": ["@com_github_ziglang_zig//:musl"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
)
|
||||
|
||||
go_binary(
|
||||
name = "go",
|
||||
embed = [":go_lib"],
|
||||
visibility = ["//visibility:public"],
|
||||
static = "on",
|
||||
)
|
||||
Reference in New Issue
Block a user