Skip to content

Commit 707a4cf

Browse files
committed
Remove REQUIRED as not all the platform has pthread library.
1 parent dff3b33 commit 707a4cf

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

flang-rt/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ check_cxx_compiler_flag(-fno-lto FLANG_RT_HAS_FNO_LTO_FLAG)
248248
# Different platform may have different name for the POSIX thread library.
249249
# For example, libpthread.a on AIX. Search for it as it is needed when
250250
# building the shared flang_rt.runtime.so.
251-
find_package(Threads REQUIRED)
251+
find_package(Threads)
252252

253253
# function checks
254254
find_package(Backtrace)

flang-rt/cmake/modules/AddFlangRT.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ function (add_flangrt_library name)
142142
endif ()
143143
if (build_shared)
144144
add_library("${name_shared}" SHARED ${extra_args} ${ARG_ADDITIONAL_HEADERS} ${ARG_UNPARSED_ARGUMENTS})
145-
target_link_libraries(${name_shared} PUBLIC Threads::Threads)
145+
if (Threads_FOUND)
146+
target_link_libraries(${name_shared} PUBLIC Threads::Threads)
147+
endif ()
146148
endif ()
147149

148150
if (libtargets)

0 commit comments

Comments
 (0)