Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit c971ffe

Browse files
committed
Merge branch 'fix-vs2015' into peter-b/test-vs2015
Conflict in configure.bat; reworked to call `config.py` script.
2 parents 36275d0 + beb25ad commit c971ffe

26 files changed

+656
-1289
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ prebuilt/lib
121121
prebuilt/build
122122
prebuilt/packaged
123123
prebuilt/fetched
124+
prebuilt/unpacked
124125

125126
# Stamp files and generated C files
126127
###################################

config/win32.gypi

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
{
22
'variables':
33
{
4-
# Path to the Windows SDK for Apple QuickTime
5-
'quicktime_sdk%': '$(foo)C:/Program Files/QuickTime SDK',
6-
74
# Path to versions 4 and 5 of the Microsoft Speech SDK
85
'ms_speech_sdk4%': '$(foo)C:/Program Files/Microsoft Speech SDK',
96
'ms_speech_sdk5%': '$(foo)C:/Program Files/Microsoft Speech SDK 5.1',
@@ -47,8 +44,6 @@
4744

4845
'VCLinkerTool':
4946
{
50-
'AdditionalOptions': '/NODEFAULTLIB:LIBCMT',
51-
'LinkIncremental': '2',
5247
'OptimizeReferences': '2',
5348
'GenerateDebugInformation': 'true',
5449
'EnableCOMDATFolding': '2',
@@ -168,6 +163,11 @@
168163
{
169164
'WarningLevel': '0',
170165
},
166+
167+
'MASM':
168+
{
169+
'WarningLevel': '0',
170+
}
171171
},
172172
},
173173
],
@@ -181,12 +181,31 @@
181181
'BufferSecurityCheck': 'false',
182182
'RuntimeTypeInfo': 'false',
183183
'Detect64BitPortabilityProblems': 'false',
184+
185+
# Silence abundent warnings to speed up build:
186+
# 4577: exception handling mode mismatch
187+
# 4800: performance warning about cast to bool
188+
# 4244: possible loss of data due to int-like truncation
189+
'DisableSpecificWarnings': '4577;4800;4244',
184190
},
185191

192+
'VCLibrarianTool':
193+
{
194+
'AdditionalOptions':
195+
[
196+
'/MACHINE:<(target_arch)',
197+
],
198+
},
199+
186200
'VCLinkerTool':
187201
{
188202
'SubSystem': '2',
189203
'RandomizedBaseAddress': '1', # /DYNAMICBASE:NO - disable ASLR
204+
'ImageHasSafeExceptionHandlers': 'false',
205+
'AdditionalOptions':
206+
[
207+
'/MACHINE:<(target_arch)',
208+
],
190209
},
191210
},
192211
},

configure.bat

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,19 @@ SET warnings=0
99
REM Not all versions of windows the the %programfiles(x86)% variable
1010
IF NOT DEFINED programfiles(x86) SET programfiles(x86)=%programfiles%
1111

12+
REM When calling configure.bat from the command line, BUILD_EDITION is not defined
13+
IF NOT DEFINED BUILD_EDITION SET BUILD_EDITION="community"
14+
15+
REM Target architecture currently defaults to 32-bit x86
16+
IF NOT DEFINED TARGET_ARCH SET TARGET_ARCH=x86
17+
18+
REM The internal MSVC/Gyp name for x86_64 is x64
19+
IF %TARGET_ARCH%==x86_64 (
20+
SET MSVC_ARCH=x64
21+
) ELSE (
22+
SET MSVC_ARCH=%TARGET_ARCH%
23+
)
24+
1225
REM Note: to test whether a directory exists in batch script, you need to check
1326
REM whether a file within that directory exists. Easiest way to do this is to
1427
REM add the "*" wildcard after the directory
@@ -23,21 +36,12 @@ IF %ERRORLEVEL% NEQ 0 (
2336
) ELSE (
2437
ECHO >&2 Error: could not locate a copy of python
2538
PAUSE
26-
EXIT 1
39+
EXIT /B 1
2740
)
2841
) ELSE (
2942
SET python=python
3043
)
3144

32-
REM Attempt to locate the QuickTime SDK
33-
IF EXIST "%programfiles(x86)%\QuickTime SDK\*" (
34-
SET extra_options=%extra_options% -Dquicktime_sdk="%programfiles(x86)%/QuickTime SDK"
35-
) ELSE (
36-
ECHO >&2 Error: could not locate the QuickTime SDK
37-
PAUSE
38-
EXIT 1
39-
)
40-
4145
REM Attempt to locate the Microsoft Speech SDK v5.1
4246
IF EXIST "%programfiles(x86)%\Microsoft Speech SDK 5.1\*" (
4347
SET extra_options=%extra_options% -Dms_speech_sdk5="%programfiles(x86)%/Microsoft Speech SDK 5.1"
@@ -46,21 +50,13 @@ IF EXIST "%programfiles(x86)%\Microsoft Speech SDK 5.1\*" (
4650
SET warnings=1
4751
)
4852

49-
REM Attempt to locate the Microsoft Speech SDK v4
50-
IF EXIST "%programfiles(x86)%\Microsoft Speech SDK\*" (
51-
SET extra_options=%extra_options% -Dms_speech_sdk4="%programfiles(x86)%/Microsoft Speech SDK"
52-
) ELSE (
53-
ECHO >&2 Warning: could not locate the Microsoft Speech SDK v4; revSpeech will not build
54-
SET warnings=1
55-
)
56-
5753
REM Pause so any warnings can be seen
5854
IF %warnings% NEQ 0 PAUSE
5955

6056
REM Run the configure step
61-
%python% config.py --platform win-x86 %extra_options% %gypfile%
57+
%python% config.py --platform win-x86 -Dtarget_arch=%MSVC_ARCH% %extra_options% %gypfile%
6258
PAUSE
6359

6460
REM Pause if there was an error so that the user gets a chance to see it
6561
IF %ERRORLEVEL% NEQ 0 PAUSE
66-
EXIT %ERRORLEVEL%
62+
EXIT /B %ERRORLEVEL%

gyp/pylib/gyp/MSVSSettings.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,3 +1097,8 @@ def _ValidateSettings(validators, settings, stderr):
10971097

10981098
# Options that have the same name in MSVS and MSBuild.
10991099
_Same(_masm, 'UseSafeExceptionHandlers', _boolean) # /safeseh
1100+
_Same(_masm, 'WarningLevel',
1101+
_Enumeration(['0', # /W0
1102+
'1', # /W1
1103+
'2', # /W2
1104+
'3'])) # /W3

libcore/src/core.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,11 @@ bool MCThrow(uint32_t p_error)
6262

6363
#if defined(_WINDOWS) || defined(_WINDOWS_SERVER)
6464

65+
#include <windows.h>
6566
#include <crtdbg.h>
6667
#include <dbghelp.h>
6768

68-
extern "C"
69-
_CRTIMP int __cdecl _VCrtDbgReportA(
70-
int nRptType,
71-
const char * szFile,
72-
int nLine,
73-
const char * szModule,
74-
const char * szFormat,
75-
va_list arglist
76-
);
69+
extern "C" USHORT WINAPI RtlCaptureStackBackTrace(ULONG, ULONG, PVOID*, PULONG);
7770

7871
void __MCAssert(const char *p_file, uint32_t p_line, const char *p_message)
7972
{

libfoundation/include/foundation-auto.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,20 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
2828

2929
template<typename T> class MCAutoValueRefBase;
3030

31-
template<typename T> inline T In(const MCAutoValueRefBase<T>& p_auto)
31+
template<typename T>
32+
T In(const MCAutoValueRefBase<T>& p_auto)
3233
{
3334
return p_auto . In();
3435
}
3536

36-
template<typename T> inline T& Out(MCAutoValueRefBase<T>& p_auto)
37+
template<typename T>
38+
T& Out(MCAutoValueRefBase<T>& p_auto)
3739
{
3840
return p_auto . Out();
3941
}
4042

41-
template<typename T> inline T& InOut(MCAutoValueRefBase<T>& p_auto)
43+
template<typename T>
44+
T& InOut(MCAutoValueRefBase<T>& p_auto)
4245
{
4346
return p_auto . InOut();
4447
}
@@ -139,20 +142,20 @@ template<typename T> class MCAutoValueRefBase
139142
T m_value;
140143

141144
// Return the contents of the auto pointer in a form for an in parameter.
142-
inline T In(void) const
145+
T In(void) const
143146
{
144147
return m_value;
145148
}
146149

147150
// Return the contents of the auto pointer in a form for an out parameter.
148-
inline T& Out(void)
151+
T& Out(void)
149152
{
150153
MCAssert(m_value == nil);
151154
return m_value;
152155
}
153156

154157
// Return the contents of the auto pointer in a form for an inout parameter.
155-
inline T& InOut(void)
158+
T& InOut(void)
156159
{
157160
return m_value;
158161
}

libfoundation/include/foundation.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,10 +459,12 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
459459
# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6)
460460
# define constexpr /*constexpr*/
461461
# endif
462-
# elif defined(_MSC_VER) && (_MCS_VER < 1900)
462+
# elif defined(_MSC_VER)
463463
// MSVC added C++11 constexpr in Visual Studio 2015 (compiler
464464
// version 14.0, _MSC_VER 1900)
465-
# define constexpr /*constexpr*/
465+
# if _MSC_VER < 1900
466+
# define constexpr /*constexpr*/
467+
# endif
466468
# else
467469
# error Do not know whether this compiler provides C++11 constexpr
468470
# endif

libfoundation/src/foundation-debug.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,7 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
2929
#include <crtdbg.h>
3030
#include <dbghelp.h>
3131

32-
extern "C"
33-
_CRTIMP int __cdecl _VCrtDbgReportA(
34-
int nRptType,
35-
const char * szFile,
36-
int nLine,
37-
const char * szModule,
38-
const char * szFormat,
39-
va_list arglist
40-
);
32+
extern "C" USHORT WINAPI RtlCaptureStackBackTrace(ULONG, ULONG, PVOID*, PULONG);
4133

4234
void __MCAssert(const char *p_file, uint32_t p_line, const char *p_message)
4335
{

prebuilt/build-all-libs.bat

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
@ECHO OFF
2+
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
3+
4+
SET "LOCKPATH=%TEMP%\build-all-libs-locks"
5+
IF EXIST "%LOCKPATH%" (
6+
RMDIR /S /Q %LOCKPATH%
7+
IF %ERRORLEVEL% NEQ 0 (
8+
ECHO "Build all libs already running"
9+
EXIT /B 1
10+
)
11+
)
12+
13+
IF "%1"=="" (
14+
SET LIBS=openssl,curl,icu
15+
) ELSE (
16+
SET LIBS=%1
17+
)
18+
19+
SET TOOL=14
20+
FOR /f "tokens=1* delims=," %%L IN ("%LIBS%") DO (
21+
SET LIB=%%L
22+
23+
ECHO Building !LIB! for four configurations
24+
25+
MKDIR %LOCKPATH%
26+
FOR %%M IN (debug,release) DO (
27+
FOR %%A IN (x86,x86_64) DO (
28+
SET MODE=%%M
29+
SET ARCH=%%A
30+
31+
REM The prepare step is done synchronously
32+
ECHO Preparing %%L-%%M-%%A
33+
CALL build-libs.bat %%L prepare
34+
35+
REM The build step is done asynchronously
36+
ECHO Starting %%L-%%M-%%A
37+
START "%%L-%%M-%%A" 9>"%LOCKPATH%\%%L-%%M-%%A.lock" CMD /C build-libs.bat %%L
38+
)
39+
)
40+
41+
ECHO Waiting for all !LIB! builds to finish
42+
43+
:WaitForEnd
44+
1>NUL 2>NUL PING /n 2 ::1
45+
FOR %%K IN (!LIB!-debug-x86,!LIB!-release-x86,!LIB!-debug-x86_64,!LIB!-release-x86_64) DO (
46+
(CALL ) 9>"%LOCKPATH%\%%K.lock" || GOTO :WaitForEnd
47+
) 2>NUL
48+
49+
RMDIR /S /Q %LOCKPATH%
50+
51+
ECHO Finished building !LIB! for four configurations
52+
)

0 commit comments

Comments
 (0)