Skip to content

Commit 4cc32e6

Browse files
[SYCL][sycl-rel] Fix AddSecurityFlags having no side effects (#17796)
This is a cherry-pick of #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
1 parent 1b7ef61 commit 4cc32e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/cmake/modules/AddSecurityFlags.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ macro(add_link_option_ext flag name)
3131
endif()
3232
endmacro()
3333

34-
function(append_common_extra_security_flags)
34+
macro(append_common_extra_security_flags)
3535
if( LLVM_ON_UNIX )
3636
# Fortify Source (strongly recommended):
3737
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
@@ -70,7 +70,7 @@ function(append_common_extra_security_flags)
7070
CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS
7171
CMAKE_SHARED_LINKER_FLAGS)
7272
endif()
73-
endfunction()
73+
endmacro()
7474

7575
if ( EXTRA_SECURITY_FLAGS )
7676
if (EXTRA_SECURITY_FLAGS STREQUAL "none")

0 commit comments

Comments
 (0)