Skip to content

Commit 57b4c7c

Browse files
committed
fixup: dependency from git, remove git submodule
1 parent 1200dbb commit 57b4c7c

File tree

6 files changed

+18
-61
lines changed

6 files changed

+18
-61
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[submodule "core/instrument-hooks"]
2-
path = core/instrument-hooks
3-
url = https://github.com/CodSpeedHQ/instrument-hooks

MODULE.bazel

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
11
bazel_dep(name = "rules_cc", version = "0.0.17")
2+
bazel_dep(name = "instrument_hooks", version = "1.0.0")
3+
4+
git_override(
5+
module_name = "instrument_hooks",
6+
commit = "a2971f00dd2a9ce475d4f28ca2a1d7e4ec41eefd",
7+
remote = "https://github.com/CodSpeedHQ/instrument-hooks",
8+
)

core/BUILD

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,6 @@ config_setting(
88
constraint_values = ["@platforms//os:windows"],
99
)
1010

11-
# Define the instrument-hooks library separately to apply warning suppressions
12-
cc_library(
13-
name = "instrument_hooks",
14-
srcs = ["instrument-hooks/dist/core.c"],
15-
hdrs = glob(["instrument-hooks/includes/*.h"]),
16-
includes = ["instrument-hooks/includes"],
17-
copts = select({
18-
":windows": [
19-
"/wd4101", # unreferenced local variable (equivalent to -Wno-unused-variable)
20-
"/wd4189", # local variable is initialized but not referenced (equivalent to -Wno-unused-but-set-variable)
21-
"/wd4100", # unreferenced formal parameter (equivalent to -Wno-unused-parameter)
22-
],
23-
"//conditions:default": [
24-
"-Wno-unused-variable",
25-
"-Wno-unused-parameter",
26-
"-Wno-unused-but-set-variable",
27-
],
28-
}),
29-
)
3011

3112
# Define the codspeed library
3213
cc_library(
@@ -45,7 +26,7 @@ cc_library(
4526
":walltime_mode": ["CODSPEED_ENABLED", "CODSPEED_WALLTIME"],
4627
"//conditions:default": [],
4728
}),
48-
deps = [":instrument_hooks"],
29+
deps = ["//core/instrument-hooks:instrument_hooks"],
4930
visibility = ["//visibility:public"],
5031
)
5132

core/CMakeLists.txt

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,14 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
1010

1111
# Add the include directory
1212
include_directories(include)
13-
include_directories(instrument-hooks/includes)
1413

15-
# Add the library
16-
add_library(
14+
include(FetchContent)
15+
FetchContent_Declare(
1716
instrument_hooks
18-
instrument-hooks/dist/core.c
17+
GIT_REPOSITORY https://github.com/CodSpeedHQ/instrument-hooks/
18+
GIT_TAG a2971f00dd2a9ce475d4f28ca2a1d7e4ec41eefd
1919
)
20-
21-
# Suppress warnings for the instrument_hooks library
22-
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
23-
target_compile_options(
24-
instrument_hooks
25-
PRIVATE
26-
-Wno-maybe-uninitialized
27-
-Wno-unused-variable
28-
-Wno-unused-parameter
29-
-Wno-unused-but-set-variable
30-
-Wno-type-limits
31-
)
32-
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
33-
target_compile_options(
34-
instrument_hooks
35-
PRIVATE
36-
/wd4101 # unreferenced local variable (equivalent to -Wno-unused-variable)
37-
/wd4189 # local variable is initialized but not referenced (equivalent to -Wno-unused-but-set-variable)
38-
/wd4100 # unreferenced formal parameter (equivalent to -Wno-unused-parameter)
39-
/wd4245 # signed/unsigned mismatch
40-
/wd4132 # const object should be initialized
41-
/wd4146 # unary minus operator applied to unsigned type
42-
)
43-
endif()
20+
FetchContent_MakeAvailable(instrument_hooks)
4421

4522
# Add the main library
4623
add_library(
@@ -61,7 +38,6 @@ add_compile_definitions(CODSPEED_VERSION="${CODSPEED_VERSION}")
6138
target_include_directories(
6239
codspeed
6340
PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
64-
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/instrument-hooks/includes>
6541
)
6642

6743
# Disable valgrind compilation errors

core/instrument-hooks

Lines changed: 0 additions & 1 deletion
This file was deleted.

google_benchmark/MODULE.bazel

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,11 @@ python.toolchain(
2828
)
2929
python.toolchain(python_version = "3.13")
3030

31-
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip", dev_dependency = True)
32-
pip.parse(
33-
hub_name = "tools_pip_deps",
34-
python_version = "3.9",
35-
requirements_lock = "//tools:requirements.txt",
31+
# -- bazel_dep definitions -- #
32+
33+
local_path_override(
34+
module_name = "instrument_hooks",
35+
path = "../core/instrument-hooks",
3636
)
37-
use_repo(pip, "tools_pip_deps")
3837

39-
# -- bazel_dep definitions -- #
4038

41-
bazel_dep(name = "nanobind_bazel", version = "2.5.0", dev_dependency = True)

0 commit comments

Comments
 (0)