Skip to content

Commit

Permalink
Add [email protected] with required library sources. (#3220)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminp authored Nov 19, 2024
1 parent 87593ef commit dca6a98
Show file tree
Hide file tree
Showing 6 changed files with 162 additions and 1 deletion.
17 changes: 17 additions & 0 deletions modules/boost.context/1.83.0.bcr.2/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module(
name = "boost.context",
version = "1.83.0.bcr.2",
bazel_compatibility = [">=7.2.1"],
compatibility_level = 108300,
)

bazel_dep(name = "bazel_skylib", version = "1.3.0")
bazel_dep(name = "boost.assert", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.config", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.core", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.mp11", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.pool", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.predef", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.smart_ptr", version = "1.83.0.bcr.1")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "rules_cc", version = "0.0.13")
112 changes: 112 additions & 0 deletions modules/boost.context/1.83.0.bcr.2/overlay/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
load("@rules_cc//cc:defs.bzl", "cc_library")

# Rename .asm to .S so that it will be handled with the C preprocessor.
[copy_file(
name = "rename_%s" % name,
src = "src/asm/%s_x86_64_ms_pe_masm.asm" % name,
out = "src/asm/%s_x86_64_ms_pe_masm.S" % name,
) for name in [
"make",
"jump",
"ontop",
]]

filegroup(
name = "elf_asm",
srcs = select({
"@platforms//cpu:aarch64": [
"src/asm/jump_arm64_aapcs_elf_gas.S",
"src/asm/make_arm64_aapcs_elf_gas.S",
"src/asm/ontop_arm64_aapcs_elf_gas.S",
],
"@platforms//cpu:arm": [
"src/asm/jump_arm_aapcs_elf_gas.S",
"src/asm/make_arm_aapcs_elf_gas.S",
"src/asm/ontop_arm_aapcs_elf_gas.S",
],
"@platforms//cpu:x86_64": [
"src/asm/jump_x86_64_sysv_elf_gas.S",
"src/asm/make_x86_64_sysv_elf_gas.S",
"src/asm/ontop_x86_64_sysv_elf_gas.S",
],
}),
)

filegroup(
name = "apple_asm",
srcs = select({
"@platforms//cpu:aarch64": [
"src/asm/jump_arm64_aapcs_macho_gas.S",
"src/asm/make_arm64_aapcs_macho_gas.S",
"src/asm/ontop_arm64_aapcs_macho_gas.S",
],
"@platforms//cpu:arm": [
"src/asm/jump_arm_aapcs_macho_gas.S",
"src/asm/make_arm_aapcs_macho_gas.S",
"src/asm/ontop_arm_aapcs_macho_gas.S",
],
"@platforms//cpu:x86_64": [
"src/asm/jump_x86_64_sysv_macho_gas.S",
"src/asm/make_x86_64_sysv_macho_gas.S",
"src/asm/ontop_x86_64_sysv_macho_gas.S",
],
}),
)

cc_library(
name = "boost.context",
srcs = select({
"@platforms//os:windows": [
"src/asm/jump_x86_64_ms_pe_masm.S",
"src/asm/make_x86_64_ms_pe_masm.S",
"src/asm/ontop_x86_64_ms_pe_masm.S",
"src/windows/stack_traits.cpp",
],
"@platforms//os:macos": [
"src/posix/stack_traits.cpp",
":apple_asm",
],
"//conditions:default": [
"src/posix/stack_traits.cpp",
":elf_asm",
],
}),
hdrs = glob(
[
"include/**/*.hpp",
],
exclude = [
"include/boost/context/continuation_winfib.hpp",
"include/boost/context/fiber_winfib.hpp",
"include/boost/context/posix/segmented_stack.hpp",
"include/boost/context/preallocated.hpp",
"include/boost/context/windows/protected_fixedsize_stack.hpp",
],
),
features = [
"parse_headers",
],
includes = ["include"],
local_defines = select({
"@platforms//os:windows": ["BOOST_CONTEXT_EXPORT="],
"//conditions:default": [],
}),
textual_hdrs = [
"include/boost/context/continuation_winfib.hpp",
"include/boost/context/fiber_winfib.hpp",
"include/boost/context/posix/segmented_stack.hpp",
"include/boost/context/preallocated.hpp",
"include/boost/context/windows/protected_fixedsize_stack.hpp",
],
visibility = ["//visibility:public"],
deps = [
"@boost.assert",
"@boost.config",
"@boost.core",
"@boost.mp11",
"@boost.pool",
"@boost.predef",
"@boost.smart_ptr",
],
)
1 change: 1 addition & 0 deletions modules/boost.context/1.83.0.bcr.2/overlay/MODULE.bazel
20 changes: 20 additions & 0 deletions modules/boost.context/1.83.0.bcr.2/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
matrix:
platform:
- debian10
- debian11
- macos
- macos_arm64
- ubuntu2004
- ubuntu2204
- ubuntu2404
- windows
bazel: [7.x, rolling]
tasks:
verify_targets:
name: Verify build targets
platform: ${{ platform }}
bazel: ${{ bazel }}
build_flags:
- '--process_headers_in_dependencies'
build_targets:
- '@boost.context//:boost.context'
10 changes: 10 additions & 0 deletions modules/boost.context/1.83.0.bcr.2/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"integrity": "sha256-/MbSfQikFDWSwmkTTdI7K3qGkW36YhmZW9JKTu/P5Oo=",
"strip_prefix": "context-boost-1.83.0",
"url": "https://github.com/boostorg/context/archive/refs/tags/boost-1.83.0.tar.gz",
"patch_strip": 0,
"overlay": {
"MODULE.bazel": "sha256-ntEJGQzI52xkPjx1IQTxnQWVftsCIDyVhGB/zpAoi1s=",
"BUILD.bazel": "sha256-QQmw7I62WkUBY1Gs04lpDyXHM5eTTE+TwanMCLFan6s="
}
}
3 changes: 2 additions & 1 deletion modules/boost.context/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
],
"versions": [
"1.83.0",
"1.83.0.bcr.1"
"1.83.0.bcr.1",
"1.83.0.bcr.2"
],
"yanked_versions": {}
}

0 comments on commit dca6a98

Please sign in to comment.