Skip to content

Commit d57bf44

Browse files
committed
Correct sanitize.cmake
Signed-off-by: Isaev, Ilya <[email protected]>
1 parent a60794a commit d57bf44

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

cmake/sanitize.cmake

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# Copyright (c) 2020-2022 Intel Corporation
1+
# Copyright (c) 2020-2025 Intel Corporation
2+
# Copyright (c) 2025 UXL Foundation Contributors
23
#
34
# Licensed under the Apache License, Version 2.0 (the "License");
45
# you may not use this file except in compliance with the License.
@@ -14,14 +15,22 @@
1415

1516
set(TBB_SANITIZE ${TBB_SANITIZE} CACHE STRING "Sanitizer parameter passed to compiler/linker" FORCE)
1617
# Possible values of sanitizer parameter for cmake-gui for convenience, user still can use any other value.
17-
set_property(CACHE TBB_SANITIZE PROPERTY STRINGS "thread" "memory" "leak" "address -fno-omit-frame-pointer")
18+
set_property(CACHE TBB_SANITIZE PROPERTY STRINGS "thread" "memory" "leak" "address")
1819

1920
if (NOT TBB_SANITIZE)
2021
return()
2122
endif()
2223

2324
set(TBB_SANITIZE_OPTION -fsanitize=${TBB_SANITIZE})
2425

26+
if (TBB_SANITIZE MATCHES "thread")
27+
set(TBB_SANITIZE_OPTION "${TBB_SANITIZE_OPTION} -Wno-tsan")
28+
endif()
29+
30+
if (TBB_SANITIZE MATCHES "address")
31+
set(TBB_SANITIZE_OPTION "${TBB_SANITIZE_OPTION} -fno-omit-frame-pointer")
32+
endif()
33+
2534
# It is required to add sanitizer option to CMAKE_REQUIRED_LIBRARIES to make check_cxx_compiler_flag working properly:
2635
# sanitizer option should be passed during the compilation phase as well as during the compilation.
2736
set(CMAKE_REQUIRED_LIBRARIES "${TBB_SANITIZE_OPTION} ${CMAKE_REQUIRED_LIBRARIES}")

0 commit comments

Comments
 (0)