From ccde282afdb6956f08b59d97583caf8a2b4b8a59 Mon Sep 17 00:00:00 2001 From: Alexey Sachkov Date: Mon, 31 Mar 2025 12:21:28 +0200 Subject: [PATCH] [SYCL] Fix AddSecurityFlags having no side effects (#17690) CMake has a notion of scopes for variables and we fell into a pitfall of setting local variables instead of applying changes globally to the whole project. For reference, see: - https://cmake.org/cmake/help/v3.20/command/set.html - https://cmake.org/cmake/help/v3.20/command/include.html --- llvm/cmake/modules/AddSecurityFlags.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/cmake/modules/AddSecurityFlags.cmake b/llvm/cmake/modules/AddSecurityFlags.cmake index 774ca47b5cd6e..d43b35cbd4f30 100644 --- a/llvm/cmake/modules/AddSecurityFlags.cmake +++ b/llvm/cmake/modules/AddSecurityFlags.cmake @@ -31,7 +31,7 @@ macro(add_link_option_ext flag name) endif() endmacro() -function(append_common_extra_security_flags) +macro(append_common_extra_security_flags) if( LLVM_ON_UNIX ) # Fortify Source (strongly recommended): if (CMAKE_BUILD_TYPE STREQUAL "Debug") @@ -70,7 +70,7 @@ function(append_common_extra_security_flags) CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS) endif() -endfunction() +endmacro() if ( EXTRA_SECURITY_FLAGS ) if (EXTRA_SECURITY_FLAGS STREQUAL "none")