Skip to content

Commit 8f35262

Browse files
authored
Merge pull request #2334 from IntelPython/mark-compiler-headers-as-system
Suppress compiler deprecation warnings on Windows
2 parents 06e657d + e58988c commit 8f35262

3 files changed

Lines changed: 13 additions & 6 deletions

File tree

cmake/IntelSYCLConfig.cmake

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,9 @@ set_property(TARGET IntelSYCL::SYCL_CXX PROPERTY
304304
set_property(TARGET IntelSYCL::SYCL_CXX PROPERTY
305305
INTERFACE_LINK_OPTIONS ${SYCL_LINK_FLAGS})
306306
set_property(TARGET IntelSYCL::SYCL_CXX PROPERTY
307-
INTERFACE_INCLUDE_DIRECTORIES ${SYCL_INCLUDE_DIR})
307+
INTERFACE_INCLUDE_DIRECTORIES $<BUILD_INTERFACE:${SYCL_INCLUDE_DIR}>)
308+
set_property(TARGET IntelSYCL::SYCL_CXX PROPERTY
309+
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES ${SYCL_INCLUDE_DIR})
308310
set_property(TARGET IntelSYCL::SYCL_CXX PROPERTY
309311
INTERFACE_LINK_DIRECTORIES ${SYCL_LIBRARY_DIR})
310312

@@ -343,12 +345,13 @@ Adding sycl to all sources but that may effect compilation times")
343345
if(NOT SYCL_SOURCES)
344346
message(WARNING "add_sycl_to_target() does not have sources specified.. Adding sycl to all sources but that may effect compilation times")
345347
target_compile_options(${SYCL_TARGET} PUBLIC ${__sycl_cxx_options})
346-
target_include_directories(${SYCL_TARGET} PUBLIC ${__sycl_cxx_include_directories})
348+
target_include_directories(${SYCL_TARGET} SYSTEM PUBLIC ${__sycl_cxx_include_directories})
349+
else()
350+
target_include_directories(${SYCL_TARGET} SYSTEM PRIVATE ${__sycl_cxx_include_directories})
347351
endif()
348352

349353
foreach(source ${SYCL_SOURCES})
350354
set_source_files_properties(${source} PROPERTIES COMPILE_OPTIONS "${__sycl_cxx_options}")
351-
set_source_files_properties(${source} PROPERTIES INCLUDE_DIRECTORIES "${__sycl_cxx_include_directories}")
352355
endforeach()
353356

354357
get_target_property(__sycl_link_options

libsyclinterface/CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,13 +314,14 @@ if(DPCTL_GENERATE_COVERAGE)
314314
endif()
315315

316316
target_include_directories(DPCTLSyclInterface
317-
# PUBLIC
318317
PRIVATE
319318
${CMAKE_CURRENT_SOURCE_DIR}/include/syclinterface
320319
${CMAKE_CURRENT_SOURCE_DIR}/include/syclinterface/Support
321320
${CMAKE_CURRENT_SOURCE_DIR}/include/syclinterface/Config
322-
# PRIVATE
323321
${CMAKE_CURRENT_SOURCE_DIR}/helper/include/
322+
)
323+
target_include_directories(DPCTLSyclInterface
324+
SYSTEM PRIVATE
324325
${SYCL_INCLUDE_DIR}
325326
)
326327

@@ -354,7 +355,7 @@ endif()
354355

355356
if(DPCTL_ENABLE_L0_PROGRAM_CREATION)
356357
target_include_directories(DPCTLSyclInterface
357-
PRIVATE
358+
SYSTEM PRIVATE
358359
${LEVEL_ZERO_INCLUDE_DIR}
359360
)
360361
endif()

libsyclinterface/tests/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ target_include_directories(dpctl_c_api_tests
8787
PRIVATE
8888
"${CMAKE_CURRENT_SOURCE_DIR}/../helper/include"
8989
"${CMAKE_CURRENT_SOURCE_DIR}/../include/syclinterface"
90+
)
91+
target_include_directories(dpctl_c_api_tests
92+
SYSTEM PRIVATE
9093
${LEVEL_ZERO_INCLUDE_DIR}
9194
)
9295

0 commit comments

Comments
 (0)