Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 3 additions & 21 deletions sycl/test-e2e/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ endif() # Standalone.

if(SYCL_TEST_E2E_STANDALONE)
set(SYCL_CXX_COMPILER ${CMAKE_CXX_COMPILER})
set(SYCL_E2E_CLANG_CXX_FLAGS ${CMAKE_CXX_FLAGS})
else()
set(SYCL_CXX_COMPILER "${LLVM_BINARY_DIR}/bin/clang++")
# Don't want options used for building sycl-toolchain.
unset(CMAKE_CXX_FLAGS)
set(SYCL_E2E_CLANG_CXX_FLAGS "" CACHE STRING
"Flags passed to clang++ when building SYCL end-to-end tests")
endif() # Standalone.

find_package(Threads REQUIRED)
Expand All @@ -65,25 +66,6 @@ if(NOT SYCL_TEST_E2E_TARGETS)
set(SYCL_TEST_E2E_TARGETS "all")
endif()

if(MSVC AND NOT SYCL_TEST_E2E_STANDALONE)
# We're trying to pass MSVC flags to Clang, which doesn't work by default
separate_arguments(cxx_flags NATIVE_COMMAND "${CMAKE_CXX_FLAGS}")
foreach(flag IN ITEMS ${cxx_flags})
# Skip certain flags that only exists for MSVC
if("${flag}" STREQUAL "/EHsc")
continue()
endif()
# Change the way compiler definitions are passed in
string(REGEX REPLACE "^/D" "-D" clang_flag "${flag}")
list(APPEND SYCL_E2E_CLANG_CXX_FLAGS ${clang_flag})
endforeach()
string (REPLACE ";" " " SYCL_E2E_CLANG_CXX_FLAGS "${SYCL_E2E_CLANG_CXX_FLAGS}")
else()
set(SYCL_E2E_CLANG_CXX_FLAGS ${CMAKE_CXX_FLAGS})
endif()

set(SYCL_E2E_CLANG_CXX_FLAGS "${SYCL_E2E_CLANG_CXX_FLAGS} -Werror")

if(NOT DEFINED CUDA_LIBS_DIR AND NOT DEFINED CUDA_INCLUDE)
find_package(CUDAToolkit)

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,7 @@ def get_sycl_ls_verbose(sycl_device, env):
config.substitutions.append(("%clangxx", " true "))
config.substitutions.append(("%clang", " true "))
else:
clangxx = " " + config.dpcpp_compiler + " "
clangxx = " " + config.dpcpp_compiler + " -Werror "
if "preview-mode" in config.available_features:
# Technically, `-fpreview-breaking-changes` is reported as unused option
# if used without `-fsycl`. However, we have far less tests compiling
Expand Down