Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Commit 4582876

Browse files
authored
Unpin cmake_format after v0.5.2 bug fixes. (#328)
This is a followup to #317.
1 parent c9a4da3 commit 4582876

File tree

7 files changed

+54
-45
lines changed

7 files changed

+54
-45
lines changed

cmake/OpenCensusDeps.cmake

Lines changed: 29 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,20 @@
1414

1515
include(FetchContent)
1616

17-
fetchcontent_declare(googletest
18-
GIT_REPOSITORY
19-
https://github.com/abseil/googletest
20-
GIT_TAG
21-
ed2fe122f8dc9aca844d724986d1d5cf5b65ea4e)
22-
fetchcontent_declare(abseil
23-
GIT_REPOSITORY
24-
https://github.com/abseil/abseil-cpp
25-
GIT_TAG
26-
2c8421e1c6cef0da9e8a20b01c15256ec9ec116d)
27-
fetchcontent_declare(prometheus
28-
GIT_REPOSITORY
29-
https://github.com/jupp0r/prometheus-cpp
30-
GIT_TAG
31-
master)
32-
fetchcontent_declare(benchmark
33-
GIT_REPOSITORY
34-
https://github.com/google/benchmark
35-
GIT_TAG
36-
master)
17+
FetchContent_Declare(googletest
18+
GIT_REPOSITORY https://github.com/abseil/googletest
19+
GIT_TAG ed2fe122f8dc9aca844d724986d1d5cf5b65ea4e)
20+
FetchContent_Declare(abseil
21+
GIT_REPOSITORY https://github.com/abseil/abseil-cpp
22+
GIT_TAG 2c8421e1c6cef0da9e8a20b01c15256ec9ec116d)
23+
FetchContent_Declare(prometheus
24+
GIT_REPOSITORY https://github.com/jupp0r/prometheus-cpp
25+
GIT_TAG master)
26+
FetchContent_Declare(benchmark
27+
GIT_REPOSITORY https://github.com/google/benchmark
28+
GIT_TAG master)
3729

38-
fetchcontent_getproperties(googletest)
30+
FetchContent_GetProperties(googletest)
3931
if(BUILD_TESTING)
4032
message(STATUS "Dependency: googletest (BUILD_TESTING=${BUILD_TESTING})")
4133
if(NOT googletest_POPULATED)
@@ -52,44 +44,44 @@ if(BUILD_TESTING)
5244
ON)
5345
endif()
5446

55-
fetchcontent_populate(googletest)
47+
FetchContent_Populate(googletest)
5648
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR}
5749
EXCLUDE_FROM_ALL)
5850
endif()
5951
endif()
6052

61-
fetchcontent_getproperties(abseil)
53+
FetchContent_GetProperties(abseil)
6254
if(NOT abseil_POPULATED)
6355
message(STATUS "Dependency: abseil")
64-
fetchcontent_populate(abseil)
56+
FetchContent_Populate(abseil)
6557
add_subdirectory(${abseil_SOURCE_DIR} ${abseil_BINARY_DIR} EXCLUDE_FROM_ALL)
6658
endif()
6759

68-
fetchcontent_getproperties(prometheus)
60+
FetchContent_GetProperties(prometheus)
6961
if(NOT prometheus_POPULATED)
7062
message(STATUS "Dependency: prometheus")
7163
set(ENABLE_PUSH OFF CACHE BOOL "Build prometheus-cpp push library" FORCE)
7264
set(ENABLE_PULL OFF CACHE BOOL "Build prometheus-cpp pull library" FORCE)
73-
set(ENABLE_COMPRESSION OFF
74-
CACHE BOOL "Enable gzip compression for prometheus-cpp"
75-
FORCE)
65+
set(ENABLE_COMPRESSION
66+
OFF
67+
CACHE BOOL "Enable gzip compression for prometheus-cpp" FORCE)
7668
set(ENABLE_TESTING OFF CACHE BOOL "Build test for prometheus-cpp" FORCE)
77-
fetchcontent_populate(prometheus)
69+
FetchContent_Populate(prometheus)
7870
add_subdirectory(${prometheus_SOURCE_DIR} ${prometheus_BINARY_DIR}
7971
EXCLUDE_FROM_ALL)
8072
endif()
8173

82-
fetchcontent_getproperties(benchmark)
74+
FetchContent_GetProperties(benchmark)
8375
if(BUILD_TESTING)
8476
message(STATUS "Dependency: benchmark (BUILD_TESTING=${BUILD_TESTING})")
8577
if(NOT benchmark_POPULATED)
86-
set(BENCHMARK_ENABLE_TESTING OFF
87-
CACHE BOOL "Enable testing of the benchmark library."
88-
FORCE)
89-
set(BENCHMARK_ENABLE_GTEST_TESTS OFF
90-
CACHE BOOL "Enable building the unit tests which depend on gtest"
91-
FORCE)
92-
fetchcontent_populate(benchmark)
78+
set(BENCHMARK_ENABLE_TESTING
79+
OFF
80+
CACHE BOOL "Enable testing of the benchmark library." FORCE)
81+
set(BENCHMARK_ENABLE_GTEST_TESTS
82+
OFF
83+
CACHE BOOL "Enable building the unit tests which depend on gtest" FORCE)
84+
FetchContent_Populate(benchmark)
9385
add_subdirectory(${benchmark_SOURCE_DIR} ${benchmark_BINARY_DIR}
9486
EXCLUDE_FROM_ALL)
9587
endif()

cmake/OpenCensusHelpers.cmake

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ function(opencensus_test NAME SRC)
3333
set(_NAME "opencensus_${NAME}")
3434
add_executable(${_NAME} ${SRC})
3535
prepend_opencensus(DEPS "${ARGN}")
36-
target_link_libraries(${_NAME} "${DEPS}" gmock gtest_main)
36+
target_link_libraries(${_NAME}
37+
"${DEPS}"
38+
gmock
39+
gtest_main)
3740
add_test(NAME ${_NAME} COMMAND ${_NAME})
3841
endif()
3942
endfunction()
@@ -54,7 +57,11 @@ endfunction()
5457
# Helper function like bazel's cc_library. Libraries are namespaced as
5558
# opencensus_* and public libraries are also aliased as opencensus-cpp::*.
5659
function(opencensus_lib NAME)
57-
cmake_parse_arguments(ARG "PUBLIC" "" "SRCS;DEPS" ${ARGN})
60+
cmake_parse_arguments(ARG
61+
"PUBLIC"
62+
""
63+
"SRCS;DEPS"
64+
${ARGN})
5865
set(_NAME "opencensus_${NAME}")
5966
prepend_opencensus(ARG_DEPS "${ARG_DEPS}")
6067
if(ARG_SRCS)

opencensus/stats/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
opencensus_lib(stats PUBLIC DEPS stats_core stats_recording)
15+
opencensus_lib(stats
16+
PUBLIC
17+
DEPS
18+
stats_core
19+
stats_recording)
1620

1721
opencensus_lib(stats_test_utils
1822
PUBLIC

opencensus/trace/CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,10 @@ opencensus_test(trace_sampler_test
148148
absl::synchronization
149149
absl::time)
150150

151-
opencensus_test(trace_span_test internal/span_test.cc trace absl::strings)
151+
opencensus_test(trace_span_test
152+
internal/span_test.cc
153+
trace
154+
absl::strings)
152155

153156
opencensus_test(trace_span_id_test internal/span_id_test.cc trace)
154157

@@ -172,7 +175,10 @@ opencensus_test(trace_span_exporter_test
172175
absl::synchronization
173176
absl::time)
174177

175-
opencensus_test(trace_status_test internal/status_test.cc trace absl::strings)
178+
opencensus_test(trace_status_test
179+
internal/status_test.cc
180+
trace
181+
absl::strings)
176182

177183
opencensus_test(trace_trace_config_test
178184
internal/trace_config_test.cc

tools/docker-format/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ FROM ubuntu:cosmic
33
RUN apt update && \
44
apt install -y clang-format golang git python-pip && \
55
go get -v github.com/bazelbuild/buildtools/buildifier && \
6-
pip install cmake_format==0.4.5
6+
pip install 'cmake_format>=0.5.2'
77

88
CMD ["/bin/bash"]

tools/format.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ if [[ "$tools_check" == "y" ]]; then
7777
-name '*.cmake' -print)
7878
else
7979
echo "Can't find cmake-format. It can be installed with:"
80-
echo " pip install --user cmake_format"
80+
echo " pip install --user 'cmake_format>=0.5.2'"
8181
fi
8282
fi
8383

tools/travis/check_format.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ if ! which buildifier >/dev/null; then
2121
go get -v github.com/bazelbuild/buildtools/buildifier
2222
fi
2323
# Install cmake-format.
24-
pip install --user cmake_format==0.4.5
24+
pip install --user 'cmake_format>=0.5.2'
2525
# Check format.
2626
tools/format.sh

0 commit comments

Comments
 (0)