فهرست منبع

HPCC-19467 Fix problems with windows stand alone compiling

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 7 سال پیش
والد
کامیت
1b5f9692cb
4فایلهای تغییر یافته به همراه64 افزوده شده و 12 حذف شده
  1. 28 3
      deploy/vc2008/bin/cl.bat
  2. 31 4
      deploy/vc2008/bin/link.bat
  3. 4 4
      rtl/include/eclhelper.hpp
  4. 1 1
      system/jlib/jcomp.cpp

+ 28 - 3
deploy/vc2008/bin/cl.bat

@@ -1,7 +1,7 @@
 @echo off
 rem /*##############################################################################
 rem 
-rem     HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
+rem     HPCC SYSTEMS software Copyright (C) 2018 HPCC Systems®.
 rem 
 rem     Licensed under the Apache License, Version 2.0 (the "License");
 rem     you may not use this file except in compliance with the License.
@@ -18,6 +18,31 @@ rem ############################################################################
 
 setlocal
 
-REM This is for Visual Studio 2008 / Visual C++ Express edition
-call "%VS90COMNTOOLS%vsvars32"
+if NOT "%VS150COMNTOOLS%"=="" (
+  rem VS2017 version 15.x
+  rem Path and environment variables should already be set up if VsDevCmd.bat has been run
+  goto found:
+)
+if NOT "%VS140COMNTOOLS%"=="" (
+  rem VS2015 version 14.x
+  call "%VS140COMNTOOLS%vsvars32"
+  goto found:
+)
+if NOT "%VS130COMNTOOLS%"=="" (
+  rem VS2013 version 13.x
+  call "%VS130COMNTOOLS%vsvars32"
+  goto found:
+)
+
+rem Older versions do not support c++11 so will not compile the queries
+
+echo Error: Could not locate a supported version of visual studio.
+
+rem Visual Studio 2017 does not install a %VS150COMNTOOLS% variable by default.
+if EXIST "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" (
+  echo Try executing "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" first
+)
+exit 2;
+
+:found
 cl.exe %*

+ 31 - 4
deploy/vc2008/bin/link.bat

@@ -1,7 +1,7 @@
 @echo off
 rem /*##############################################################################
 rem 
-rem     HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
+rem     HPCC SYSTEMS software Copyright (C) 2018 HPCC Systems®.
 rem 
 rem     Licensed under the Apache License, Version 2.0 (the "License");
 rem     you may not use this file except in compliance with the License.
@@ -18,6 +18,33 @@ rem ############################################################################
 
 setlocal
 
-REM This is for Visual Studio 2008
-call "%VS90COMNTOOLS%vsvars32"
-link.exe %*
+if NOT "%VS150COMNTOOLS%"=="" (
+  rem VS2017 version 15.x
+  rem Path and environment variables should already be set up if VsDevCmd.bat has been run
+  goto found:
+)
+if NOT "%VS140COMNTOOLS%"=="" (
+  rem VS2015 version 14.x
+  call "%VS140COMNTOOLS%vsvars32"
+  goto found:
+)
+if NOT "%VS130COMNTOOLS%"=="" (
+  rem VS2013 version 13.x
+  call "%VS130COMNTOOLS%vsvars32"
+  goto found:
+)
+
+rem Older versions do not support c++11 so will not compile the queries
+
+echo Error: Could not locate a supported version of visual studio.
+
+rem Visual Studio 2017 does not install a %VS150COMNTOOLS% variable by default.
+if EXIST "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" (
+  echo Try executing "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" first
+)
+
+exit 2
+
+:found
+link.exe %*
+

+ 4 - 4
rtl/include/eclhelper.hpp

@@ -57,6 +57,10 @@ typedef unsigned char byte;
 #endif
 #endif
 
+#ifdef _WIN32
+typedef size_t memsize_t;
+#endif
+
 typedef unsigned __int64 __uint64;
 typedef __uint64 offset_t;
 
@@ -1966,10 +1970,6 @@ struct IHThorKeyPatchArg : public IHThorArg
 };
 
 
-#ifdef WIN32
-typedef unsigned char byte;
-#endif
-
 struct IHThorWorkunitReadArg : public IHThorArg
 {
     virtual const char * queryName() = 0;

+ 1 - 1
system/jlib/jcomp.cpp

@@ -943,7 +943,7 @@ public:
         }
         handle = 0;
 
-        if (!success || aborted)
+        if (!success || aborted || runcode != 0)
             compiler->numFailed++;
         params->finishedCompiling.signal();
         if (error)