File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+
2
+ function (dtrace_usdt_probe script )
3
+ set (options )
4
+ set (single_parameter_options TARGET_NAME OUTPUT_SOURCES )
5
+ set (multiple_parameter_options )
6
+
7
+ cmake_parse_arguments ("" "${options} " "${single_parameter_options} " "${multiple_parameter_options} " ${ARGN} )
8
+
9
+ get_filename_component (script_we ${script} NAME_WE )
10
+
11
+ add_custom_command (OUTPUT
12
+ ${CMAKE_CURRENT_BINARY_DIR} /${script_we}.h
13
+ COMMAND
14
+ ${dtrace_EXECUTABLE} -h -s ${script} -o ${CMAKE_CURRENT_BINARY_DIR} /${script_we}.h
15
+ DEPENDS
16
+ ${script} )
17
+ add_custom_target (dtrace-usdt-header-${script_we}
18
+ DEPENDS
19
+ ${CMAKE_CURRENT_BINARY_DIR} /${script_we}.h )
20
+ if (_TARGET_NAME )
21
+ set (${_TARGET_NAME} dtrace-usdt-header-${script_we} PARENT_SCOPE )
22
+ endif ()
23
+ if (_OUTPUT_SOURCES )
24
+ set (${_OUTPUT_SOURCES} ${CMAKE_CURRENT_BINARY_DIR} /${script_we}.h PARENT_SCOPE )
25
+ endif ()
26
+ endfunction ()
Original file line number Diff line number Diff line change 1
1
2
2
include (SwiftSupport )
3
+ include (DTrace )
3
4
4
5
add_library (dispatch
5
6
allocator.c
@@ -103,11 +104,20 @@ if(CMAKE_SWIFT_COMPILER)
103
104
swift/DispatchStubs.cc
104
105
${CMAKE_CURRENT_BINARY_DIR} /swiftDispatch.o )
105
106
endif ()
107
+ if (dtrace_EXECUTABLE )
108
+ dtrace_usdt_probe (${CMAKE_CURRENT_SOURCE_DIR} /provider.d
109
+ OUTPUT_SOURCES
110
+ dispatch_dtrace_provider_headers )
111
+ target_sources (dispatch
112
+ PRIVATE
113
+ ${dispatch_dtrace_provider_headers} )
114
+ endif ()
106
115
target_include_directories (dispatch
107
116
PRIVATE
108
117
${CMAKE_BINARY_DIR}
109
118
${CMAKE_SOURCE_DIR}
110
119
${CMAKE_CURRENT_SOURCE_DIR}
120
+ ${CMAKE_CURRENT_BINARY_DIR}
111
121
${CMAKE_SOURCE_DIR} /private )
112
122
if (WITH_PTHREAD_WORKQUEUES )
113
123
target_include_directories (dispatch
You can’t perform that action at this time.
0 commit comments