This repository has been archived by the owner on Jul 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 77
CMake stackdriver enhancements #447
Open
alichnewsky
wants to merge
12
commits into
census-instrumentation:master
Choose a base branch
from
alichnewsky:cmake-stackdriver-enhancements
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5360131
enhanced CMake support ( work in progress )
alichnewsky 618a630
clang-format
alichnewsky abb9edc
fix missing } to compile. product name prefix as cli option not prepr…
alichnewsky b1af7a6
fix exports : no-more exporting of gmock, prometheus-cpp::core when i…
alichnewsky d21434d
WIP: fix travis-ci ubuntu/clang build
alichnewsky 9262d39
CMake: stackdriver exporter build only behind an option. does a find_…
alichnewsky 21e7a6b
make protobuf/grpc/stackdriver dependent target contingent to BUILD_S…
alichnewsky 1818f72
Fix travis-ci build : abseil as FetchContent means linking rule needs…
alichnewsky 357b50b
removed re2 as dependency for the new memory example, as I can\'t get…
alichnewsky 7221529
finally managed to run tools/format.sh
alichnewsky 8675d05
finally manually assembled the right versions of buildifier,clang-for…
alichnewsky c1fb529
WIP : obviously, still no good fix for formatting docker image. one l…
alichnewsky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,8 @@ project( | |
|
||
option(FUZZER "Either OFF or e.g. -fsanitize=fuzzer,address" OFF) | ||
|
||
option(BUILD_STACKDRIVER_EXPORTER "Build the stackdriver exporter" OFF) | ||
|
||
if(NOT CMAKE_CXX_STANDARD) | ||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
@@ -38,14 +40,51 @@ enable_testing() | |
|
||
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) | ||
|
||
# There are cyclical dependencies ( betwen libopencensus_trace.so and | ||
# libopencensus_context.so ) that prevent from building the code as is as shared | ||
# libraries without undefined symbols... | ||
# | ||
# Moreover, because of the way I built gRPC c++ apis within google-cloud-cpp as | ||
# shared libs, with a specific abseil version _as shared lib_ | ||
|
||
if(BUILD_SHARED_LIBS) | ||
set(POSITION_INDEPENDENT_CODE ON) | ||
set(BUILD_SHARED_LIBS NO) | ||
endif() | ||
# clearly there are problems with cyclical deps in this code ( context, trace ) | ||
if(BUILD_SHARED_LIBS) | ||
add_link_options("LINKER:--no-undefined") | ||
endif() | ||
|
||
include(GNUInstallDirs) | ||
|
||
include(OpenCensusDeps) | ||
|
||
include(OpenCensusHelpers) | ||
|
||
if(BUILD_SHARED_LIBS) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. redundant |
||
add_link_options("LINKER:--no-undefined") | ||
endif() | ||
|
||
# OpenCensus code. | ||
add_subdirectory(opencensus) | ||
|
||
# Example code only if testing is enabled. | ||
if(BUILD_TESTING) | ||
add_subdirectory(examples) | ||
endif() | ||
|
||
install(EXPORT opencensus-cpp-targets | ||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/opencensus-cpp) | ||
|
||
# we still need to create and export opencensus-cpp-config.cmake | ||
|
||
# Create and install the CMake configuration files. | ||
configure_file("${CMAKE_CURRENT_LIST_DIR}/cmake/config.cmake.in" | ||
"opencensus-cpp-config.cmake" @ONLY) | ||
configure_file("${CMAKE_CURRENT_LIST_DIR}/cmake/config-version.cmake.in" | ||
"opencensus-cpp-config-version.cmake" @ONLY) | ||
|
||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/opencensus-cpp-config.cmake" | ||
"${CMAKE_CURRENT_BINARY_DIR}/opencensus-cpp-config-version.cmake" | ||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/opencensus-cpp") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# | ||
set(PACKAGE_VERSION "@CMAKE_PROJECT_VERSION@") | ||
|
||
# Check whether the requested PACKAGE_FIND_VERSION is compatible | ||
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") | ||
set(PACKAGE_VERSION_COMPATIBLE FALSE) | ||
else() | ||
set(PACKAGE_VERSION_COMPATIBLE TRUE) | ||
if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") | ||
set(PACKAGE_VERSION_EXACT TRUE) | ||
endif() | ||
endif() | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this requires a version of cmake that's more recent than the one in the CI containers... consider a platform-aware version of this: