From 01e9613aa11250dcccd540098a91b508d0c17f4b Mon Sep 17 00:00:00 2001 From: Olga Malysheva Date: Mon, 20 Jan 2025 13:04:03 -0600 Subject: [PATCH 1/5] TBB_FILE_TRIM is not supported with Intel compiler on Windows --- cmake/compilers/MSVC.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/compilers/MSVC.cmake b/cmake/compilers/MSVC.cmake index b49e543776..3510a0561e 100644 --- a/cmake/compilers/MSVC.cmake +++ b/cmake/compilers/MSVC.cmake @@ -79,8 +79,8 @@ endif() if (TBB_FILE_TRIM) add_compile_options( - "$<$:/d1trimfile:${NATIVE_TBB_PROJECT_ROOT_DIR}\\>" - "$<$:/d1trimfile:${CMAKE_SOURCE_DIR}/>") + "$<$AND:$,$>>:/d1trimfile:${NATIVE_TBB_PROJECT_ROOT_DIR}\\>" + "$<$AND:$,$>>:/d1trimfile:${CMAKE_SOURCE_DIR}/>") endif() if (TBB_CONTROL_FLOW_GUARD) From 475fce4acbc81ac7ec0dc38b26c0230874d4123c Mon Sep 17 00:00:00 2001 From: Olga Malysheva Date: Mon, 20 Jan 2025 13:19:32 -0600 Subject: [PATCH 2/5] Fix typo --- cmake/compilers/MSVC.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/compilers/MSVC.cmake b/cmake/compilers/MSVC.cmake index 3510a0561e..ce00f36358 100644 --- a/cmake/compilers/MSVC.cmake +++ b/cmake/compilers/MSVC.cmake @@ -79,8 +79,8 @@ endif() if (TBB_FILE_TRIM) add_compile_options( - "$<$AND:$,$>>:/d1trimfile:${NATIVE_TBB_PROJECT_ROOT_DIR}\\>" - "$<$AND:$,$>>:/d1trimfile:${CMAKE_SOURCE_DIR}/>") + "$<$<$AND:$,$>>:/d1trimfile:${NATIVE_TBB_PROJECT_ROOT_DIR}\\>" + "$<$<$AND:$,$>>:/d1trimfile:${CMAKE_SOURCE_DIR}/>") endif() if (TBB_CONTROL_FLOW_GUARD) From cc71645af5d8383f7c5f402144006a96b8b0d3c3 Mon Sep 17 00:00:00 2001 From: Olga Malysheva Date: Mon, 20 Jan 2025 13:40:52 -0600 Subject: [PATCH 3/5] Remove flag --- cmake/compilers/IntelLLVM.cmake | 1 + cmake/compilers/MSVC.cmake | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/compilers/IntelLLVM.cmake b/cmake/compilers/IntelLLVM.cmake index b514378164..af21c53943 100644 --- a/cmake/compilers/IntelLLVM.cmake +++ b/cmake/compilers/IntelLLVM.cmake @@ -17,6 +17,7 @@ if (WIN32) set(TBB_OPENMP_FLAG /Qopenmp) set(TBB_IPO_COMPILE_FLAGS $<$>:/Qipo>) set(TBB_IPO_LINK_FLAGS $<$>:/INCREMENTAL:NO>) + tbb_remove_compile_flag(/d1trimfile) else() include(${CMAKE_CURRENT_LIST_DIR}/Clang.cmake) set(TBB_IPO_COMPILE_FLAGS $<$>:-ipo>) diff --git a/cmake/compilers/MSVC.cmake b/cmake/compilers/MSVC.cmake index ce00f36358..b49e543776 100644 --- a/cmake/compilers/MSVC.cmake +++ b/cmake/compilers/MSVC.cmake @@ -79,8 +79,8 @@ endif() if (TBB_FILE_TRIM) add_compile_options( - "$<$<$AND:$,$>>:/d1trimfile:${NATIVE_TBB_PROJECT_ROOT_DIR}\\>" - "$<$<$AND:$,$>>:/d1trimfile:${CMAKE_SOURCE_DIR}/>") + "$<$:/d1trimfile:${NATIVE_TBB_PROJECT_ROOT_DIR}\\>" + "$<$:/d1trimfile:${CMAKE_SOURCE_DIR}/>") endif() if (TBB_CONTROL_FLOW_GUARD) From dff42e567ee52819ce97bea485827ff7d07998ec Mon Sep 17 00:00:00 2001 From: Olga Malysheva Date: Mon, 20 Jan 2025 14:19:42 -0600 Subject: [PATCH 4/5] Cmake condition --- cmake/compilers/IntelLLVM.cmake | 1 - cmake/compilers/MSVC.cmake | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/cmake/compilers/IntelLLVM.cmake b/cmake/compilers/IntelLLVM.cmake index af21c53943..b514378164 100644 --- a/cmake/compilers/IntelLLVM.cmake +++ b/cmake/compilers/IntelLLVM.cmake @@ -17,7 +17,6 @@ if (WIN32) set(TBB_OPENMP_FLAG /Qopenmp) set(TBB_IPO_COMPILE_FLAGS $<$>:/Qipo>) set(TBB_IPO_LINK_FLAGS $<$>:/INCREMENTAL:NO>) - tbb_remove_compile_flag(/d1trimfile) else() include(${CMAKE_CURRENT_LIST_DIR}/Clang.cmake) set(TBB_IPO_COMPILE_FLAGS $<$>:-ipo>) diff --git a/cmake/compilers/MSVC.cmake b/cmake/compilers/MSVC.cmake index b49e543776..67341e0521 100644 --- a/cmake/compilers/MSVC.cmake +++ b/cmake/compilers/MSVC.cmake @@ -77,7 +77,7 @@ if (TBB_WINDOWS_DRIVER) set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} /D _UNICODE /DUNICODE /DWINAPI_FAMILY=WINAPI_FAMILY_APP /D__WRL_NO_DEFAULT_LIB__) endif() -if (TBB_FILE_TRIM) +if (TBB_FILE_TRIM AND NOT CMAKE_CXX_COMPILER_ID MATCHES "(Intel|IntelLLVM)") add_compile_options( "$<$:/d1trimfile:${NATIVE_TBB_PROJECT_ROOT_DIR}\\>" "$<$:/d1trimfile:${CMAKE_SOURCE_DIR}/>") From a63922fac5eb36477028f06b35b30c5608e2eedc Mon Sep 17 00:00:00 2001 From: Olga Malysheva Date: Mon, 20 Jan 2025 15:07:51 -0600 Subject: [PATCH 5/5] Fix copyright --- cmake/compilers/MSVC.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/compilers/MSVC.cmake b/cmake/compilers/MSVC.cmake index 67341e0521..fdf87d6747 100644 --- a/cmake/compilers/MSVC.cmake +++ b/cmake/compilers/MSVC.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.