@@ -303,37 +303,18 @@ endif()
303303
304304# This function allows building multiple libraries with the same options.
305305# Currently used by add_sycl_library and add_sycl_rt_library.
306- # Currently handles linking with libcxx support and gcc workaround
306+ # Currently handles a gcc workaround
307307function ( add_common_options LIB_NAME)
308- if (SYCL_USE_LIBCXX)
309- if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" ) OR
310- (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" ))
311- if ((NOT (DEFINED SYCL_LIBCXX_INCLUDE_PATH)) OR (NOT (DEFINED SYCL_LIBCXX_LIBRARY_PATH)))
312- message (FATAL_ERROR "When building with libc++ SYCL_LIBCXX_INCLUDE_PATHS and"
313- "SYCL_LIBCXX_LIBRARY_PATH should be set" )
314- endif ()
315- target_link_libraries (${LIB_NAME} PRIVATE "-L${SYCL_LIBCXX_LIBRARY_PATH} " -Wl,-rpath,${SYCL_LIBCXX_LIBRARY_PATH} -nodefaultlibs -lc++ -lc++abi -lm -lc -lgcc_s -lgcc)
316- target_compile_options (${LIB_NAME} PRIVATE -nostdinc++)
317- target_include_directories (${LIB_NAME} PRIVATE "${SYCL_LIBCXX_INCLUDE_PATH} " )
318- if (ARGC EQUAL 2)
319- target_compile_options (${ARGV1} PRIVATE -nostdinc++)
320- target_include_directories (${ARGV1} PRIVATE "${SYCL_LIBCXX_INCLUDE_PATH} " )
321- endif ()
322- else ()
323- message (FATAL_ERROR "Build with libc++ is not yet supported for this compiler" )
324- endif ()
325- else ()
326308 # Workaround for bug in GCC version 5 and higher.
327309 # More information https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1568899
328310 if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND
329311 CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 5.0)
330312 target_link_libraries (${ARGV0} PRIVATE gcc_s gcc)
331313 endif ()
332- endif ()
333314endfunction (add_common_options)
334315
335316if (LLVM_ENABLE_ASSERTIONS AND NOT SYCL_DISABLE_STL_ASSERTIONS AND NOT WIN32 )
336- if (SYCL_USE_LIBCXX )
317+ if (LLVM_LIBCXX_USED )
337318 add_definitions (-D_LIBCPP_DEBUG=1)
338319 set (SYCL_CLANG_EXTRA_FLAGS "${SYCL_CLANG_EXTRA_FLAGS} -D_LIBCPP_DEBUG=1" )
339320 else ()
0 commit comments