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 ()
205205check_cxx_compiler_flag("-UTESTFLAG" FLANG_RT_SUPPORTS_UNDEFINE_FLAG)
206206
207207
208+ # function checks
209+ find_package (Backtrace)
210+ set (HAVE_BACKTRACE ${Backtrace_FOUND} )
211+ set (BACKTRACE_HEADER ${Backtrace_HEADER} )
212+
213+
208214#####################
209215# Build Preparation #
210216#####################
Original file line number Diff line number Diff line change 1616 don't. */
1717#cmakedefine01 HAVE_DECL_STRERROR_S
1818
19+ /* Define to 1 if you have the `backtrace' function. */
20+ #cmakedefine HAVE_BACKTRACE ${HAVE_BACKTRACE}
21+
22+ #define BACKTRACE_HEADER <${BACKTRACE_HEADER}>
23+
1924#endif
Original file line number Diff line number Diff line change 2828# ADDITIONAL_HEADERS
2929# May specify header files for IDE generators.
3030# 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
3234# TARGET_PROPERTIES
3335# Set target properties of all added targets
3436# )
3537function (add_flangrt_library name )
3638 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)
3840 cmake_parse_arguments (ARG
3941 "${options} "
4042 ""
@@ -160,6 +162,10 @@ function (add_flangrt_library name)
160162 target_include_directories (${name} ${ARG_INCLUDE_DIRECTORIES} )
161163 endif ()
162164
165+ if (ARG_LINK_LIBRARIES)
166+ target_link_libraries (${name} PUBLIC ${ARG_LINK_LIBRARIES} )
167+ endif ()
168+
163169 # If this is part of the toolchain, put it into the compiler's resource
164170 # directory. Otherwise it is part of testing and is not installed at all.
165171 # 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 ()
124124 set (f128_sources "" )
125125endif ()
126126
127-
128127set (sources ${supported_sources} ${host_sources} ${f128_sources} )
129128
129+
130130if (NOT WIN32 )
131131 add_flangrt_library(flang_rt.runtime STATIC
132132 ${sources}
133+ LINK_LIBRARIES ${Backtrace_LIBRARY}
133134 INSTALL_WITH_TOOLCHAIN
134135 ADDITIONAL_HEADERS ${public_headers} ${private_headers}
135136 )
@@ -151,6 +152,7 @@ else()
151152 add_flangrt_library(${name} ${libtype}
152153 ${sources}
153154 ${ARGN}
155+ LINK_LIBRARIES ${Backtrace_LIBRARY}
154156 ADDITIONAL_HEADERS ${public_headers} ${private_headers}
155157 )
156158
You can’t perform that action at this time.
0 commit comments