From 648dfc76e49b5b4b43cd4a48cbcbda6a038a9aa3 Mon Sep 17 00:00:00 2001 From: Mircea-Aurelian Dan Date: Tue, 8 Oct 2024 19:15:00 +0300 Subject: [PATCH] Refactor changes with less modifications --- thirdparty/level_zero/CMakeLists.txt | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/thirdparty/level_zero/CMakeLists.txt b/thirdparty/level_zero/CMakeLists.txt index 550b3a3bac46fe..67aba879919f2f 100644 --- a/thirdparty/level_zero/CMakeLists.txt +++ b/thirdparty/level_zero/CMakeLists.txt @@ -10,28 +10,23 @@ set(BUILD_SHARED_LIBS OFF) set(CMAKE_DEBUG_POSTFIX "") # Skip warnings as errors for thirdparty -set(ze_loader_sources_flags) # list, not string - if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - set(ze_loader_sources_flags /WX-) # solve pdb access issue set(USE_Z7 ON) # Close spectre for ze loader - set(ze_loader_sources_flags ${ze_loader_sources_flags} /Qspectre-) + add_compile_options("/WX-;/Qspectre-") elseif(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG) - set(ze_loader_sources_flags -Wno-error -Wno-undef -Wno-missing-declarations) + ov_add_compiler_flags(-Wno-error) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \ + -Wno-undef \ + -Wno-missing-declarations") if(UNUSED_BUT_SET_VARIABLE_SUPPORTED) - set(ze_loader_sources_flags ${ze_loader_sources_flags} -Wno-unused-but-set-variable) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-but-set-variable") endif() endif() set(CMAKE_COMPILE_WARNING_AS_ERROR OFF) add_subdirectory(level-zero EXCLUDE_FROM_ALL) -# Level-zero thirdparty treats warnings as errors internally, need to set compile options for its source files -get_target_property(ze_loader_sources ze_loader SOURCES) -list(FILTER ze_loader_sources INCLUDE REGEX ".*.cpp") -set_source_files_properties(${ze_loader_sources} TARGET_DIRECTORY ze_loader PROPERTIES COMPILE_OPTIONS "${ze_loader_sources_flags}") - set_property(TARGET ze_loader APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $) # This VERSION file created by L0 may cause compilation issue of oneTBB headers, so remove it