File tree Expand file tree Collapse file tree 4 files changed +22
-3
lines changed Expand file tree Collapse file tree 4 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -205,6 +205,12 @@ endif ()
205
205
check_cxx_compiler_flag ("-UTESTFLAG" FLANG_RT_SUPPORTS_UNDEFINE_FLAG )
206
206
207
207
208
+ # function checks
209
+ find_package (Backtrace )
210
+ set (HAVE_BACKTRACE ${Backtrace_FOUND} )
211
+ set (BACKTRACE_HEADER ${Backtrace_HEADER} )
212
+
213
+
208
214
#####################
209
215
# Build Preparation #
210
216
#####################
Original file line number Diff line number Diff line change 16
16
don't. */
17
17
#cmakedefine01 HAVE_DECL_STRERROR_S
18
18
19
+ /* Define to 1 if you have the `backtrace' function. */
20
+ #cmakedefine HAVE_BACKTRACE ${HAVE_BACKTRACE}
21
+
22
+ #define BACKTRACE_HEADER <${BACKTRACE_HEADER}>
23
+
19
24
#endif
Original file line number Diff line number Diff line change 28
28
# ADDITIONAL_HEADERS
29
29
# May specify header files for IDE generators.
30
30
# INCLUDE_DIRECTORIES
31
- # Additional include_directories for all added targets
31
+ # Additional target_include_directories for all added targets
32
+ # LINK_LIBRARIES
33
+ # Additional target_link_libraries for all added targets
32
34
# TARGET_PROPERTIES
33
35
# Set target properties of all added targets
34
36
# )
35
37
function (add_flangrt_library name )
36
38
set (options STATIC SHARED OBJECT INSTALL_WITH_TOOLCHAIN EXCLUDE_FROM_ALL LINK_TO_LLVM )
37
- set (multiValueArgs ADDITIONAL_HEADERS INCLUDE_DIRECTORIES TARGET_PROPERTIES )
39
+ set (multiValueArgs ADDITIONAL_HEADERS INCLUDE_DIRECTORIES LINK_LIBRARIES TARGET_PROPERTIES )
38
40
cmake_parse_arguments (ARG
39
41
"${options} "
40
42
""
@@ -160,6 +162,10 @@ function (add_flangrt_library name)
160
162
target_include_directories (${name} ${ARG_INCLUDE_DIRECTORIES} )
161
163
endif ()
162
164
165
+ if (ARG_LINK_LIBRARIES )
166
+ target_link_libraries (${name} PUBLIC ${ARG_LINK_LIBRARIES} )
167
+ endif ()
168
+
163
169
# If this is part of the toolchain, put it into the compiler's resource
164
170
# directory. Otherwise it is part of testing and is not installed at all.
165
171
# TODO: Consider multi-configuration builds (MSVC_IDE, "Ninja Multi-Config")
Original file line number Diff line number Diff line change @@ -124,12 +124,13 @@ else ()
124
124
set (f128_sources "" )
125
125
endif ()
126
126
127
-
128
127
set (sources ${supported_sources} ${host_sources} ${f128_sources} )
129
128
129
+
130
130
if (NOT WIN32 )
131
131
add_flangrt_library (flang_rt.runtime STATIC
132
132
${sources}
133
+ LINK_LIBRARIES ${Backtrace_LIBRARY}
133
134
INSTALL_WITH_TOOLCHAIN
134
135
ADDITIONAL_HEADERS ${public_headers} ${private_headers}
135
136
)
@@ -151,6 +152,7 @@ else()
151
152
add_flangrt_library (${name} ${libtype}
152
153
${sources}
153
154
${ARGN}
155
+ LINK_LIBRARIES ${Backtrace_LIBRARY}
154
156
ADDITIONAL_HEADERS ${public_headers} ${private_headers}
155
157
)
156
158
You can’t perform that action at this time.
0 commit comments