Fix build on systems with space in path (#32169)
authorMarius Gundersen <me@mariusgundersen.net>
Sun, 16 Feb 2020 04:43:40 +0000 (05:43 +0100)
committerGitHub <noreply@github.com>
Sun, 16 Feb 2020 04:43:40 +0000 (20:43 -0800)
This fixes building the project on systems where there is a space in the path of the user. For example on Windows where the user might (hypothetically) be called 'Marius Gundersen' and the path to their user folder is `C:\Users\Marius Gundersen\` the build would fail

This fixes #32165

src/coreclr/pgosupport.cmake

index 7e24b7d2f2102187912141b3462ec73ad0a6689e..4b11980901712d964f3f5538306b647d3617f707 100644 (file)
@@ -30,8 +30,8 @@ function(add_pgo TargetName)
             message("PGO data file NOT found: ${ProfilePath}")
         else(NOT EXISTS ${ProfilePath})
             if(CLR_CMAKE_HOST_WIN32)
-                set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS_RELEASE        " /LTCG /USEPROFILE:PGD=${ProfilePath}")
-                set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS_RELWITHDEBINFO " /LTCG /USEPROFILE:PGD=${ProfilePath}")
+                set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS_RELEASE        " /LTCG /USEPROFILE:PGD=\"${ProfilePath}\"")
+                set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS_RELWITHDEBINFO " /LTCG /USEPROFILE:PGD=\"${ProfilePath}\"")
             else(CLR_CMAKE_HOST_WIN32)
                 if(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL RELEASE OR UPPERCASE_CMAKE_BUILD_TYPE STREQUAL RELWITHDEBINFO)
                     if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.6)