From d2565bb11308f6cf98d838e828d9bcbe2d51e0e4 Mon Sep 17 00:00:00 2001 From: Alexandre Ganea <37383324+aganea@users.noreply.github.com> Date: Thu, 1 Feb 2024 08:14:05 -0500 Subject: [PATCH] [openmp] On Windows, fix standalone cmake build (#80174) This fixes: https://github.com/llvm/llvm-project/issues/80117 --- openmp/cmake/HandleOpenMPOptions.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/openmp/cmake/HandleOpenMPOptions.cmake b/openmp/cmake/HandleOpenMPOptions.cmake index 201aeabbd3df9c..71346201129b68 100644 --- a/openmp/cmake/HandleOpenMPOptions.cmake +++ b/openmp/cmake/HandleOpenMPOptions.cmake @@ -9,6 +9,14 @@ if (NOT COMMAND append_if) endfunction() endif() +if (NOT COMMAND append) + function(append value) + foreach(variable ${ARGN}) + set(${variable} "${${variable}} ${value}" PARENT_SCOPE) + endforeach(variable) + endfunction() +endif() + # MSVC and clang-cl in compatibility mode map -Wall to -Weverything. # TODO: LLVM adds /W4 instead, check if that works for the OpenMP runtimes. if (NOT MSVC)