1

downgrade glibc to 2.19 and update README

This commit is contained in:
2021-06-07 23:17:19 +03:00
committed by Motiejus Jakštys
parent 6ed6563a37
commit b826ad9439
8 changed files with 49 additions and 96 deletions

View File

@@ -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

View File

@@ -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"],
)

View File

@@ -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;
}

View File

@@ -1,5 +0,0 @@
#include <iostream>
int main() {
std::cout << "Hello World!" << std::endl;
}

View File

@@ -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",
)