File tree 1 file changed +28
-0
lines changed
1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -127,5 +127,33 @@ target_compile_options(fdbdoc
127
127
-fno-omit-frame-pointer
128
128
)
129
129
130
+ # 91: Strip debug symbols into separate file
131
+
132
+ set (strip_source_file "${CMAKE_BINARY_DIR} /bin/fdbdoc" )
133
+
134
+ if (APPLE )
135
+ set (DSYMUTIL "dsymutil" )
136
+ set (STRIP "strip" )
137
+ set (strip_destination_file ${strip_source_file} .dwarf)
138
+ add_custom_command (
139
+ TARGET fdbdoc
140
+ COMMAND ${DSYMUTIL} --flat --minimize ${strip_source_file}
141
+ COMMAND ${STRIP} -u -r ${strip_source_file}
142
+ )
143
+ # set fdbdoc.dwarf file to make clean directory
144
+ set_directory_properties (PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${strip_source_file} .dwarf)
145
+ else ()
146
+ set (OBJCOPY "objcopy" )
147
+ set (strip_destination_file ${strip_source_file} .debug)
148
+ add_custom_command (
149
+ TARGET fdbdoc
150
+ COMMAND ${OBJCOPY} --only-keep-debug ${strip_source_file} ${strip_destination_file}
151
+ COMMAND ${OBJCOPY} --strip-unneeded ${strip_source_file}
152
+ COMMAND ${OBJCOPY} --add-gnu-debuglink=${strip_destination_file} ${strip_source_file}
153
+ )
154
+ # set fdbdoc.dwarf file to make clean directory
155
+ set_directory_properties (PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${strip_source_file} .debug)
156
+ endif ()
157
+
130
158
install (TARGETS fdbdoc RUNTIME DESTINATION bin)
131
159
install (PROGRAMS ${FdbMonitor_EXECUTABLE_PATH} DESTINATION lib/foundationdb/document)
You can’t perform that action at this time.
0 commit comments