[CMAKE/CLANG-CL] Don't pass /TP twice when we're dealing with a clang-cl c++ PCH...
authorAmine Khaldi <amine.khaldi@reactos.org>
Thu, 7 Dec 2017 22:22:27 +0000 (23:22 +0100)
committerAmine Khaldi <amine.khaldi@reactos.org>
Thu, 7 Dec 2017 22:22:48 +0000 (23:22 +0100)
sdk/cmake/msvc.cmake

index 19790ed..dd73927 100644 (file)
@@ -224,7 +224,9 @@ if(PCH)
 
         if(IS_CPP)
             set(_pch_language CXX)
 
         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")
         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)
 
     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}
     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")
         DEPENDS ${_asm_file})
 
     if(ARCH STREQUAL "arm")