diff --git a/clang/tools/clang-repl/CMakeLists.txt b/clang/tools/clang-repl/CMakeLists.txt index 9ffe853d759cafc..7aebbe7a19436a2 100644 --- a/clang/tools/clang-repl/CMakeLists.txt +++ b/clang/tools/clang-repl/CMakeLists.txt @@ -48,11 +48,9 @@ if(MSVC) endif() # List to '/EXPORT:sym0 /EXPORT:sym1 /EXPORT:sym2 ...' - foreach(sym ${clang_repl_exports}) - set(clang_repl_link_str "${clang_repl_link_str} /EXPORT:${sym}") - endforeach(sym ${clang_repl_exports}) + list(TRANSFORM clang_repl_exports PREPEND "LINKER:/EXPORT:") - set_property(TARGET clang-repl APPEND_STRING PROPERTY LINK_FLAGS ${clang_repl_link_str}) + set_property(TARGET clang-repl APPEND PROPERTY LINK_OPTIONS ${clang_repl_exports}) endif(MSVC) diff --git a/clang/unittests/Interpreter/CMakeLists.txt b/clang/unittests/Interpreter/CMakeLists.txt index 1ed1216c772e8fc..95378f9cfe73703 100644 --- a/clang/unittests/Interpreter/CMakeLists.txt +++ b/clang/unittests/Interpreter/CMakeLists.txt @@ -67,10 +67,7 @@ if(MSVC) endif() # List to '/EXPORT:sym0 /EXPORT:sym1 /EXPORT:sym2 ...' - foreach(sym ${ClangReplInterpreterTests_exports}) - set(ClangReplInterpreterTests_link_str "${ClangReplInterpreterTests_link_str} /EXPORT:${sym}") - endforeach(sym ${ClangReplInterpreterTests_exports}) - - set_property(TARGET ClangReplInterpreterTests APPEND_STRING PROPERTY LINK_FLAGS ${ClangReplInterpreterTests_link_str}) + list(TRANSFORM ClangReplInterpreterTests_exports PREPEND "LINKER:/EXPORT:") + set_property(TARGET ClangReplInterpreterTests APPEND PROPERTY LINK_OPTIONS ${ClangReplInterpreterTests_exports}) endif(MSVC)