https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9f85ef671270632e218d2d0c93246a3866f88851

commit 9f85ef671270632e218d2d0c93246a3866f88851
Author: Amine Khaldi <[email protected]>
AuthorDate: Thu Dec 7 23:22:27 2017 +0100

    [CMAKE/CLANG-CL] Don't pass /TP twice when we're dealing with a clang-cl 
c++ PCH. Pass -nostdinc instead of /X on clang-cl builds.
---
 sdk/cmake/msvc.cmake | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/sdk/cmake/msvc.cmake b/sdk/cmake/msvc.cmake
index 19790ed91c..dd7392756e 100644
--- a/sdk/cmake/msvc.cmake
+++ b/sdk/cmake/msvc.cmake
@@ -224,7 +224,9 @@ if(PCH)
 
         if(IS_CPP)
             set(_pch_language CXX)
-            set(_cl_lang_flag "/TP")
+            if(NOT USE_CLANG_CL)
+                set(_cl_lang_flag "/TP")
+            endif()
         else()
             set(_pch_language C)
             set(_cl_lang_flag "/TC")
@@ -443,9 +445,15 @@ function(CreateBootSectorTarget _target_name _asm_file 
_binary_file _base_addres
     set(_object_file ${_binary_file}.obj)
     set(_temp_file ${_binary_file}.tmp)
 
+    if(USE_CLANG_CL)
+        set(_no_std_includes_flag "-nostdinc")
+    else()
+        set(_no_std_includes_flag "/X")
+    endif()
+
     add_custom_command(
         OUTPUT ${_temp_file}
-        COMMAND ${CMAKE_C_COMPILER} /nologo /X 
/I${REACTOS_SOURCE_DIR}/sdk/include/asm /I${REACTOS_BINARY_DIR}/sdk/include/asm 
/I${REACTOS_SOURCE_DIR}/boot/freeldr /D__ASM__ /D_USE_ML /EP /c ${_asm_file} > 
${_temp_file}
+        COMMAND ${CMAKE_C_COMPILER} /nologo ${_no_std_includes_flag} 
/I${REACTOS_SOURCE_DIR}/sdk/include/asm /I${REACTOS_BINARY_DIR}/sdk/include/asm 
/I${REACTOS_SOURCE_DIR}/boot/freeldr /D__ASM__ /D_USE_ML /EP /c ${_asm_file} > 
${_temp_file}
         DEPENDS ${_asm_file})
 
     if(ARCH STREQUAL "arm")

Reply via email to