From 2eb0c25680be2597bb0e5a0d00ec4e1f0f3da5e0 Mon Sep 17 00:00:00 2001 From: "Agarwal, Udit" Date: Thu, 12 Sep 2024 18:48:23 -0700 Subject: [PATCH] Reuse LLVM_ENABLE_ZSTD --- buildbot/configure.py | 1 + sycl/CMakeLists.txt | 8 -------- sycl/source/CMakeLists.txt | 2 +- sycl/test-e2e/CMakeLists.txt | 6 ++++++ sycl/unittests/CMakeLists.txt | 2 +- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/buildbot/configure.py b/buildbot/configure.py index 3f55da1769965..e086e1b09c421 100644 --- a/buildbot/configure.py +++ b/buildbot/configure.py @@ -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. diff --git a/sycl/CMakeLists.txt b/sycl/CMakeLists.txt index 1f78b215fbc3f..3c529e7e5aeb2 100644 --- a/sycl/CMakeLists.txt +++ b/sycl/CMakeLists.txt @@ -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 diff --git a/sycl/source/CMakeLists.txt b/sycl/source/CMakeLists.txt index 510acc7165db8..ed6db74fdd697 100644 --- a/sycl/source/CMakeLists.txt +++ b/sycl/source/CMakeLists.txt @@ -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}) diff --git a/sycl/test-e2e/CMakeLists.txt b/sycl/test-e2e/CMakeLists.txt index 2379d7859e6a5..db9f60c0faabe 100644 --- a/sycl/test-e2e/CMakeLists.txt +++ b/sycl/test-e2e/CMakeLists.txt @@ -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" diff --git a/sycl/unittests/CMakeLists.txt b/sycl/unittests/CMakeLists.txt index 09a279821cb54..0d8b2ac283c17 100644 --- a/sycl/unittests/CMakeLists.txt +++ b/sycl/unittests/CMakeLists.txt @@ -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()