Skip to content

[SYCL] Fix passing extra clang flags to lit tests #4110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 16, 2021
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
2 changes: 1 addition & 1 deletion sycl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function( add_common_options LIB_NAME)
endif()
endfunction(add_common_options)

if (LLVM_ENABLE_ASSERTIONS AND NOT SYCL_DISABLE_STL_ASSERTIONS)
if (LLVM_ENABLE_ASSERTIONS AND NOT SYCL_DISABLE_STL_ASSERTIONS AND NOT WIN32)
if(SYCL_USE_LIBCXX)
add_definitions(-D_LIBCPP_DEBUG=1)
set(SYCL_CLANG_EXTRA_FLAGS "${SYCL_CLANG_EXTRA_FLAGS} -D_LIBCPP_DEBUG=1")
Expand Down
4 changes: 1 addition & 3 deletions sycl/test/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
# test_exec_root: The root path where tests should be run.
config.test_exec_root = os.path.join(config.sycl_obj_root, 'test')

llvm_config.use_clang()
llvm_config.use_clang(additional_flags=config.sycl_clang_extra_flags.split(' '))

# Propagate some variables from the host environment.
llvm_config.with_system_environment(['PATH', 'OCL_ICD_FILENAMES', 'SYCL_DEVICE_ALLOWLIST', 'SYCL_CONFIG_FILE_NAME'])
Expand All @@ -62,8 +62,6 @@
config.available_features.add('libcxx')
llvm_config.with_system_environment('LD_LIBRARY_PATH')
llvm_config.with_environment('LD_LIBRARY_PATH', config.sycl_libs_dir, append_path=True)
llvm_config.with_system_environment('CFLAGS')
llvm_config.with_environment('CFLAGS', config.sycl_clang_extra_flags)

elif platform.system() == "Windows":
config.available_features.add('windows')
Expand Down
5 changes: 2 additions & 3 deletions sycl/test/on-device/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
# test_exec_root: The root path where tests should be run.
config.test_exec_root = os.path.join(config.sycl_obj_root, 'test')

llvm_config.use_clang(use_installed=True)
llvm_config.use_clang(use_installed=True,
additional_flags=config.sycl_clang_extra_flags.split(' '))

# Propagate some variables from the host environment.
llvm_config.with_system_environment(['PATH', 'OCL_ICD_FILENAMES', 'SYCL_DEVICE_ALLOWLIST', 'SYCL_CONFIG_FILE_NAME'])
Expand All @@ -57,8 +58,6 @@
config.available_features.add('linux')
llvm_config.with_system_environment(['LD_LIBRARY_PATH','LIBRARY_PATH','CPATH'])
llvm_config.with_environment('LD_LIBRARY_PATH', config.sycl_libs_dir, append_path=True)
llvm_config.with_system_environment('CFLAGS')
llvm_config.with_environment('CFLAGS', config.sycl_clang_extra_flags)

elif platform.system() == "Windows":
config.available_features.add('windows')
Expand Down