Skip to content

Commit

Permalink
Reuse LLVM_ENABLE_ZSTD
Browse files Browse the repository at this point in the history
  • Loading branch information
uditagarwal97 committed Sep 13, 2024
1 parent 022a7ef commit 2eb0c25
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
1 change: 1 addition & 0 deletions buildbot/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ def do_configure(args):
"-DSYCL_BUILD_PI_HIP_PLATFORM={}".format(sycl_build_pi_hip_platform),
"-DLLVM_BUILD_TOOLS=ON",
"-DLLVM_ENABLE_ZSTD=ON",
"-DLLVM_USE_STATIC_ZSTD=ON",
"-DSYCL_ENABLE_WERROR={}".format(sycl_werror),
"-DCMAKE_INSTALL_PREFIX={}".format(install_dir),
"-DSYCL_INCLUDE_TESTS=ON", # Explicitly include all kinds of SYCL tests.
Expand Down
8 changes: 0 additions & 8 deletions sycl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -329,14 +329,6 @@ if (LLVM_ENABLE_ASSERTIONS AND NOT SYCL_DISABLE_STL_ASSERTIONS AND NOT WIN32)
endif()
endif()

# Need zstd for device image compression.
find_package(zstd)
if (zstd_FOUND)
set(SYCL_ZSTD_AVAILABLE ON)
else()
set(SYCL_ZSTD_AVAILABLE OFF)
endif()

set(SYCL_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})

# SYCL runtime library
Expand Down
2 changes: 1 addition & 1 deletion sycl/source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function(add_sycl_rt_library LIB_NAME LIB_OBJ_NAME)
# being found on Windows CI machines.
set(CMAKE_FIND_DEBUG_MODE 1)

if (NOT SYCL_ZSTD_AVAILABLE)
if (NOT LLVM_ENABLE_ZSTD)
target_compile_definitions(${LIB_OBJ_NAME} PRIVATE SYCL_RT_ZSTD_NOT_AVAIABLE)
else()
target_link_libraries(${LIB_NAME} PRIVATE ${zstd_STATIC_LIBRARY})
Expand Down
6 changes: 6 additions & 0 deletions sycl/test-e2e/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ if(NOT SYCL_TEST_E2E_STANDALONE)
)
endif() # Standalone.

if(SYCL_TEST_E2E_STANDALONE)
if( NOT zstd_FOUND )
find_package(zstd)
endif()
endif() # Standalone.

add_custom_target(check-sycl-e2e
COMMAND ${Python3_EXECUTABLE} ${LLVM_LIT} ${SYCL_E2E_TESTS_LIT_FLAGS} .
COMMENT "Running SYCL End-to-End tests"
Expand Down
2 changes: 1 addition & 1 deletion sycl/unittests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ add_subdirectory(builtins)
add_subdirectory(buffer/l0_specific)

# Enable compression unit-tests only if zstd is present.
if (SYCL_ZSTD_AVAILABLE)
if (LLVM_ENABLE_ZSTD)
add_subdirectory(compression)
endif()

Expand Down

0 comments on commit 2eb0c25

Please sign in to comment.