Skip to content

Commit 5778810

Browse files
authored
[SYCL][libdevice] Remove invalid noreturn warning for glibcxx_assert (#18657)
Signed-off-by: jinge90 <ge.jin@intel.com>
1 parent 59ab93d commit 5778810

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

libdevice/cmake/modules/SYCLLibdevice.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
include(CheckCXXCompilerFlag)
12
set(obj_binary_dir "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
23
set(obj-new-offload_binary_dir "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
34
if (MSVC)
@@ -344,6 +345,7 @@ if("native_cpu" IN_LIST SYCL_ENABLE_BACKENDS)
344345
COMPONENT libsycldevice)
345346
endif()
346347

348+
check_cxx_compiler_flag(-Wno-invalid-noreturn HAS_NO_INVALID_NORETURN_WARN_FLAG)
347349
# Add all device libraries for each filetype except for the Intel math function
348350
# ones.
349351
add_devicelibs(libsycl-itt-stubs
@@ -358,7 +360,9 @@ add_devicelibs(libsycl-itt-user-wrappers
358360

359361
add_devicelibs(libsycl-crt
360362
SRC crt_wrapper.cpp
361-
DEPENDENCIES ${crt_obj_deps})
363+
DEPENDENCIES ${crt_obj_deps}
364+
EXTRA_OPTS $<$<BOOL:${HAS_NO_INVALID_NORETURN_WARN_FLAG}>:-Wno-invalid-noreturn>)
365+
362366
add_devicelibs(libsycl-complex
363367
SRC complex_wrapper.cpp
364368
DEPENDENCIES ${complex_obj_deps})

0 commit comments

Comments
 (0)