2
0
Эх сурвалжийг харах

Fix compiling issues in x86 configuration (#2875)

Fix compiling issues in x86 configuration when using a target other than x64

The script didn't set the -A parameter that vs2019 depends on in any but the x64 case

Additional simplifications and documentation to configandbuild function
Minmin Gong 5 жил өмнө
parent
commit
5731e77620

+ 1 - 1
tools/clang/lib/SPIRV/AstTypeProbe.cpp

@@ -683,7 +683,7 @@ bool isSameType(const ASTContext &astContext, QualType type1, QualType type2) {
         // consider them different.
         if (fieldTypes1.size() != fieldTypes2.size())
           return false;
-        for (auto i = 0; i < fieldTypes1.size(); ++i)
+        for (size_t i = 0; i < fieldTypes1.size(); ++i)
           if (!isSameType(astContext, fieldTypes1[i], fieldTypes2[i]))
             return false;
         return true;

+ 15 - 7
utils/hct/hctbuild.cmd

@@ -208,6 +208,12 @@ rem End SPIRV change
 
 set BUILD_ARM_CROSSCOMPILING=0
 
+if /i "%BUILD_ARCH%"=="Win32" (
+  if "%BUILD_VS_VER%"=="2019" (
+    set VS2019ARCH=-AWin32
+  )
+)
+
 if /i "%BUILD_ARCH%"=="x64" (
   set BUILD_GENERATOR=%BUILD_GENERATOR% %BUILD_ARCH:x64=Win64%
   if "%BUILD_VS_VER%"=="2019" (
@@ -219,11 +225,17 @@ if /i "%BUILD_ARCH%"=="x64" (
 if /i "%BUILD_ARCH%"=="arm" (
   set BUILD_GENERATOR_PLATFORM=ARM
   set BUILD_ARM_CROSSCOMPILING=1
+  if "%BUILD_VS_VER%"=="2019" (
+    set VS2019ARCH=-AARM
+  )
 )
 
 if /i "%BUILD_ARCH%"=="arm64" (
   set BUILD_GENERATOR_PLATFORM=ARM64
   set BUILD_ARM_CROSSCOMPILING=1
+  if "%BUILD_VS_VER%"=="2019" (
+    set VS2019ARCH=-AARM64
+  )
 )
 
 if "%1"=="-ninja" (
@@ -359,6 +371,7 @@ rem %1 - the conf name
 rem %2 - the platform name
 rem %3 - the build directory
 rem %4 - the generator name
+rem %5 - the vs2019 architecture name
 if not exist %3 (
   mkdir %3
   if errorlevel 1 (
@@ -375,13 +388,8 @@ if "%DO_SETUP%"=="1" (
     cmake -DCMAKE_BUILD_TYPE:STRING=%1 %CMAKE_OPTS% -G %4 %HLSL_SRC_DIR% >> %3\cmake-log.txt 2>&1
   ) else (
     rem -DCMAKE_BUILD_TYPE:STRING=%1 is not necessary for multi-config generators like VS
-    if "%BUILD_VS_VER%"=="2019" (
-      echo Running cmake %CMAKE_OPTS% -G %4 %5 %HLSL_SRC_DIR% > %3\cmake-log.txt
-      cmake %CMAKE_OPTS% -G %4 %5 %HLSL_SRC_DIR% >> %3\cmake-log.txt 2>&1
-    ) else (
-      echo Running cmake %CMAKE_OPTS% -G %4 %HLSL_SRC_DIR% > %3\cmake-log.txt
-      cmake %CMAKE_OPTS% -G %4 %5 %HLSL_SRC_DIR% >> %3\cmake-log.txt 2>&1
-    )
+    echo Running cmake %CMAKE_OPTS% -G %4 %5 %HLSL_SRC_DIR% > %3\cmake-log.txt
+    cmake %CMAKE_OPTS% -G %4 %5 %HLSL_SRC_DIR% >> %3\cmake-log.txt 2>&1
   )
   if errorlevel 1 (
     echo Failed to configure cmake projects.