@@ -25,14 +25,31 @@ set(CPACK_PACKAGE_VERSION_MINOR ${LIGHTSTEP_VERSION_MINOR})
25
25
set (CPACK_PACKAGE_VERSION_PATCH ${LIGHTSTEP_VERSION_PATCH} )
26
26
include (CPack )
27
27
28
-
29
28
# ==============================================================================
30
29
# Set up options
31
30
32
31
option (WITH_ASAN "Generate tests using address-sanitizer." OFF )
33
32
option (WITH_TSAN "Generate tests using thread-sanitizer." OFF )
34
33
option (WITH_GRPC "Build with support for gRPC." ON )
35
34
option (ENABLE_LINTING "Run clang-tidy on sources if available." ON )
35
+ option (HEADERS_ONLY "Only generate config.h and version.h." OFF )
36
+
37
+ if (WITH_GRPC )
38
+ set (LIGHTSTEP_USE_GRPC 1 )
39
+ endif ()
40
+
41
+ # ==============================================================================
42
+ # Set up generated header files config.h and version.h
43
+
44
+ configure_file (version .h.in include /lightstep/version.h )
45
+ configure_file (config.h.in include /lightstep/config.h )
46
+ include_directories (${CMAKE_CURRENT_BINARY_DIR} /include )
47
+ install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} /include/lightstep
48
+ DESTINATION include )
49
+
50
+ if (HEADERS_ONLY )
51
+ return ()
52
+ endif ()
36
53
37
54
# ==============================================================================
38
55
# Configure compiler warnings
@@ -74,7 +91,6 @@ set(LIGHTSTEP_LINK_LIBRARIES ${OPENTRACING_LIBRARY}
74
91
${PROTOBUF_LIBRARIES} )
75
92
76
93
if (WITH_GRPC )
77
- set (LIGHTSTEP_USE_GRPC 1 )
78
94
find_program (GRPC_CPP_PLUGIN grpc_cpp_plugin )
79
95
if (NOT GRPC_CPP_PLUGIN )
80
96
message (FATAL_ERROR "grpc_cpp_plugin not found!" )
@@ -89,7 +105,6 @@ endif()
89
105
# ==============================================================================
90
106
# Configure sanitizers
91
107
92
- set (LIGHTSTEP_USE_ASAN OFF )
93
108
if (WITH_ASAN AND (("${CMAKE_CXX_COMPILER_ID} " MATCHES "Clang" ) OR
94
109
("${CMAKE_CXX_COMPILER_ID} " STREQUAL "GNU" AND
95
110
"${COMPILER_VERSION} " VERSION_GREATER "4.8" )))
@@ -98,7 +113,6 @@ if (WITH_ASAN AND (("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") OR
98
113
set (ASAN_LD_FLAGS -fsanitize=address )
99
114
endif ()
100
115
101
- set (LIGHTSTEP_USE_TSAN OFF )
102
116
if (WITH_TSAN AND (("${CMAKE_CXX_COMPILER_ID} " MATCHES "Clang" ) OR
103
117
("${CMAKE_CXX_COMPILER_ID} " STREQUAL "GNU" AND
104
118
"${COMPILER_VERSION} " VERSION_GREATER "4.8" )))
@@ -107,15 +121,6 @@ if (WITH_TSAN AND (("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") OR
107
121
set (TSAN_LD_FLAGS -fsanitize=thread )
108
122
endif ()
109
123
110
- # ==============================================================================
111
- # Set up generated header files config.h and version.h
112
-
113
- configure_file (version .h.in include /lightstep/version.h )
114
- configure_file (config.h.in include /lightstep/config.h )
115
- include_directories (${CMAKE_CURRENT_BINARY_DIR} /include )
116
- install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} /include/lightstep
117
- DESTINATION include )
118
-
119
124
# ==============================================================================
120
125
# Build LightStep tracer library
121
126
0 commit comments