Skip to content

Commit

Permalink
Fix empty glob in boost.thread (bazelbuild#3142)
Browse files Browse the repository at this point in the history
Needs skip-url-check

---------

Co-authored-by: Daisuke Nishimatsu <42202095+wep21@users.noreply.github.com>
  • Loading branch information
hofbi and wep21 authored Nov 11, 2024
1 parent 8dcbcf6 commit 6d2583f
Show file tree
Hide file tree
Showing 9 changed files with 486 additions and 1 deletion.
38 changes: 38 additions & 0 deletions modules/boost.thread/1.83.0.bcr.1/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
module(
name = "boost.thread",
version = "1.83.0.bcr.1",
bazel_compatibility = [">=7.2.1"],
compatibility_level = 108300,
)

bazel_dep(name = "boost.algorithm", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.assert", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.atomic", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.bind", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.chrono", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.concept_check", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.config", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.container", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.container_hash", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.core", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.date_time", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.exception", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.function", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.intrusive", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.io", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.iterator", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.lexical_cast", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.move", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.optional", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.predef", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.preprocessor", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.smart_ptr", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.static_assert", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.system", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.throw_exception", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.tuple", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.type_traits", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.utility", version = "1.83.0.bcr.1")
bazel_dep(name = "boost.winapi", version = "1.83.0.bcr.1")
bazel_dep(name = "rules_cc", version = "0.0.14")
bazel_dep(name = "platforms", version = "0.0.10")
167 changes: 167 additions & 0 deletions modules/boost.thread/1.83.0.bcr.1/overlay/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
load("@rules_cc//cc:defs.bzl", "cc_library")

package(default_visibility = ["//visibility:public"])

_COMMON_DEPS = [
"@boost.bind",
"@boost.config",
"@boost.core",
"@boost.date_time",
"@boost.move",
"@boost.system",
"@boost.type_traits",
"@boost.chrono",
]

_COMMON_HDRS = [
"include/boost/thread/detail/*.hpp",
"include/boost/thread/*.hpp",
"include/boost/thread/futures/*.hpp",
"include/boost/thread/csbl/*.hpp",
"include/boost/thread/executors/*.hpp",
]

_WINDOWS_HDRS = [
"include/boost/thread/win32/*.hpp",
]

_POSIX_HDRS = [
"include/boost/thread/pthread/*.hpp",
]

_MAC_HDRS = [
"include/boost/thread/pthread/*.hpp",
]

_WINDOWS_SRCS = [
"src/win32/*.cpp",
]

_MAC_SRCS = [
"src/pthread/once.cpp",
"src/pthread/thread.cpp",
]

_POSIX_SRCS = [
"src/pthread/thread.cpp",
"src/pthread/once.cpp",
]

_COMMON_SRCS = [
"src/future.cpp",
]

_COMMON_EXCLUDE_SRCS = ["src/pthread/once_atomic.cpp"]

cc_library(
name = "thread_posix",
srcs = glob(
_POSIX_SRCS + _COMMON_SRCS,
exclude = _COMMON_EXCLUDE_SRCS,
),
hdrs = glob(_POSIX_HDRS + _COMMON_HDRS),
defines = [
"BOOST_THREAD_DONT_USE_ATOMIC",
],
includes = ["include"],
linkopts = ["-lpthread"],
target_compatible_with = select({
"@platforms//os:windows": ["@platforms//:incompatible"],
"@platforms//os:macos": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
deps = _COMMON_DEPS,
)

cc_library(
name = "thread_windows",
srcs = glob(
_WINDOWS_SRCS + _COMMON_SRCS,
exclude = _COMMON_EXCLUDE_SRCS,
),
hdrs = glob(_WINDOWS_HDRS + _COMMON_HDRS),
defines = [
"BOOST_THREAD_WIN32",
"BOOST_THREAD_DONT_USE_ATOMIC",
],
includes = ["include"],
linkopts = ["-DEFAULTLIB:shell32"],
local_defines = [
"BOOST_THREAD_BUILD_LIB",
],
target_compatible_with = select({
"@platforms//os:windows": [],
"@platforms//os:macos": ["@platforms//:incompatible"],
"//conditions:default": ["@platforms//:incompatible"],
}),
deps = _COMMON_DEPS + [
"@boost.atomic",
],
)

cc_library(
name = "thread_mac",
srcs = glob(
_MAC_SRCS + _COMMON_SRCS,
exclude = _COMMON_EXCLUDE_SRCS,
),
hdrs = glob(_MAC_HDRS + _COMMON_HDRS),
defines = [
"BOOST_THREAD_DONT_USE_ATOMIC",
],
includes = ["include"],
target_compatible_with = select({
"@platforms//os:windows": ["@platforms//:incompatible"],
"@platforms//os:macos": [],
"//conditions:default": ["@platforms//:incompatible"],
}),
deps = _COMMON_DEPS,
)

cc_library(
name = "boost.thread",
srcs = glob(
["src/**/*.cpp"],
exclude = _POSIX_SRCS + _WINDOWS_SRCS + _MAC_SRCS + _COMMON_SRCS + _COMMON_EXCLUDE_SRCS,
),
hdrs = glob(
[
"include/**/*.hpp",
],
exclude = _POSIX_HDRS + _WINDOWS_HDRS + _MAC_HDRS + _COMMON_HDRS,
),
includes = ["include"],
deps = [
"@boost.algorithm",
"@boost.assert",
"@boost.atomic",
"@boost.concept_check",
"@boost.container",
"@boost.container_hash",
"@boost.exception",
"@boost.function",
"@boost.intrusive",
"@boost.io",
"@boost.iterator",
"@boost.lexical_cast",
"@boost.optional",
"@boost.predef",
"@boost.preprocessor",
"@boost.smart_ptr",
"@boost.static_assert",
"@boost.throw_exception",
"@boost.tuple",
"@boost.utility",
] + select({
"@platforms//os:windows": [
":thread_windows",
"@boost.winapi",
],
"@platforms//os:macos": [
":thread_mac",
],
"//conditions:default": [
":thread_posix",
],
}) + _COMMON_DEPS,
)
1 change: 1 addition & 0 deletions modules/boost.thread/1.83.0.bcr.1/overlay/MODULE.bazel
Loading

0 comments on commit 6d2583f

Please sign in to comment.