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

Commit 2fcc060

Browse files
committed
[[ VS2015 ]] Tweak environment options for VS2015
This patch tweaks various environment flags and options to ensure a build works under VS2015. It ensures that the ARCH variable is always set and defaults to x86. It maps ARCH to the Microsoft architecture name (X86 = x86 and X64 = x86_64) and ensures that it is used to set the target_arch of the build. To ensure that things build consistently targetting the correct architecture, it ensures that /MACHINE is set for the link and lib tools. Finally it ensures the gyp is called targetting VS 2015 output and the architecture specified by ARCH.
1 parent 6eba137 commit 2fcc060

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

config/win32.gypi

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@
4444

4545
'VCLinkerTool':
4646
{
47-
'AdditionalOptions': '/NODEFAULTLIB:LIBCMT',
48-
'LinkIncremental': '2',
4947
'OptimizeReferences': '2',
5048
'GenerateDebugInformation': 'true',
5149
'EnableCOMDATFolding': '2',
@@ -185,10 +183,23 @@
185183
'Detect64BitPortabilityProblems': 'false',
186184
},
187185

186+
'VCLibrarianTool':
187+
{
188+
'AdditionalOptions':
189+
[
190+
'/MACHINE:<(target_arch)',
191+
],
192+
},
193+
188194
'VCLinkerTool':
189195
{
190196
'SubSystem': '2',
191197
'RandomizedBaseAddress': '1', # /DYNAMICBASE:NO - disable ASLR
198+
'ImageHasSafeExceptionHandlers': 'false',
199+
'AdditionalOptions':
200+
[
201+
'/MACHINE:<(target_arch)',
202+
],
192203
},
193204
},
194205
},

configure.bat

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ IF NOT DEFINED programfiles(x86) SET programfiles(x86)=%programfiles%
1212
REM When calling configure.bat from the command line, BUILD_EDITION is not defined
1313
IF NOT DEFINED BUILD_EDITION SET BUILD_EDITION="community"
1414

15+
REM Target architecture currently defaults to 32-bit x86
16+
IF NOT DEFINED ARCH SET ARCH=x86
17+
18+
REM The internal MSVC/Gyp name for x86_64 is x64
19+
IF %ARCH%==x86_64 (
20+
SET MSVC_ARCH=x64
21+
) ELSE (
22+
SET MSVC_ARCH=%ARCH%
23+
)
24+
1525
REM Note: to test whether a directory exists in batch script, you need to check
1626
REM whether a file within that directory exists. Easiest way to do this is to
1727
REM add the "*" wildcard after the directory
@@ -63,8 +73,7 @@ IF /I %BUILD_EDITION% == commercial (
6373
)
6474

6575
REM Run the configure step
66-
%python% gyp\gyp_main.py --format msvs --depth . --generator-output build-win-x86/livecode -Gmsvs_version=2010 %extra_options% %gypfile%
67-
PAUSE
76+
%python% gyp\gyp_main.py --format msvs --depth . --generator-output build-win-%ARCH%/livecode -Dtarget_arch=%MSVC_ARCH% -Gmsvs_version=2015 %extra_options% %gypfile%
6877

6978
REM Pause if there was an error so that the user gets a chance to see it
7079
IF %ERRORLEVEL% NEQ 0 PAUSE

0 commit comments

Comments
 (0)