[Win] Build precompiled header successfully with clang-cl
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Jul 2017 01:11:00 +0000 (01:11 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Jul 2017 01:11:00 +0000 (01:11 +0000)
https://bugs.webkit.org/show_bug.cgi?id=174221

Patch by Stephan Szabo <stephan.szabo@sony.com> on 2017-07-06
Reviewed by Alex Christensen.

* Source/cmake/WebKitMacros.cmake:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@219228 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
Source/cmake/WebKitMacros.cmake

index 3cc7b51..a321ab4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2017-07-06  Stephan Szabo  <stephan.szabo@sony.com>
+
+        [Win] Build precompiled header successfully with clang-cl
+        https://bugs.webkit.org/show_bug.cgi?id=174221
+
+        Reviewed by Alex Christensen.
+
+        * Source/cmake/WebKitMacros.cmake:
+
 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
 
         Upgrade GCC baseline
index 713927e..d8eeffa 100644 (file)
@@ -34,9 +34,16 @@ macro(ADD_PRECOMPILED_HEADER _header _cpp _source)
         set(PrecompiledBinary "${CMAKE_CURRENT_BINARY_DIR}/${_source}/${PrecompiledBasename}.pch")
         set(_sources ${${_source}})
 
-        set_source_files_properties(${_cpp}
-            PROPERTIES COMPILE_FLAGS "/Yc\"${_header}\" /Fp\"${PrecompiledBinary}\""
-            OBJECT_OUTPUTS "${PrecompiledBinary}")
+        # clang-cl requires /FI with /Yc
+        if (COMPILER_IS_CLANG_CL)
+            set_source_files_properties(${_cpp}
+                PROPERTIES COMPILE_FLAGS "/Yc\"${_header}\" /Fp\"${PrecompiledBinary}\" /FI\"${_header}\""
+                OBJECT_OUTPUTS "${PrecompiledBinary}")
+        else ()
+            set_source_files_properties(${_cpp}
+                PROPERTIES COMPILE_FLAGS "/Yc\"${_header}\" /Fp\"${PrecompiledBinary}\""
+                OBJECT_OUTPUTS "${PrecompiledBinary}")
+        endif ()
         set_source_files_properties(${_sources}
             PROPERTIES COMPILE_FLAGS "/Yu\"${_header}\" /FI\"${_header}\" /Fp\"${PrecompiledBinary}\"")