Skip to content

Commit a91b7ce

Browse files
[SYCL] Check for -fno-rtti support when compiling syclbin-dump (#18238)
This commit changes the use of -fno-rtti to, instead of being compiler ID dependent, be dependent on whether the compiler recognizes the flag. Signed-off-by: Larsen, Steffen <[email protected]>
1 parent ecc9d15 commit a91b7ce

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sycl/tools/syclbin-dump/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
include(CheckCXXCompilerFlag)
2+
13
add_executable(syclbin-dump syclbin-dump.cpp)
24

35
link_llvm_libs(syclbin-dump LLVMSupport LLVMObject)
@@ -12,8 +14,8 @@ if (WIN32 AND "${build_type_lower}" MATCHES "debug")
1214
endif()
1315
target_link_libraries(syclbin-dump PRIVATE ${sycl_lib})
1416

15-
if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR
16-
(CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))
17+
check_cxx_compiler_flag(-fno-rtti COMPILER_HAS_NORTTI_FLAG)
18+
if (COMPILER_HAS_NORTTI_FLAG)
1719
target_compile_options(syclbin-dump PRIVATE -fno-rtti)
1820
endif()
1921

0 commit comments

Comments
 (0)