aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2016-11-05 02:37:54 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2016-11-10 00:40:16 +0530
commita90af371f68b89084eca969f65a3a024ed58edc1 (patch)
tree40e3f04294f7bd69460bc3138234a0bb25a4475c
parentda782c62dfd985d1201407e786b47f9c77b5b02b (diff)
downloadmeson-a90af371f68b89084eca969f65a3a024ed58edc1.zip
meson-a90af371f68b89084eca969f65a3a024ed58edc1.tar.gz
meson-a90af371f68b89084eca969f65a3a024ed58edc1.tar.bz2
project tests: Fix appveyor overwriting the platform env variable
There is no way to do this in the .appveyor.yml file since it seems that the appveyor environment is forcibly written after each cmd command that is run.
-rwxr-xr-xrun_project_tests.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/run_project_tests.py b/run_project_tests.py
index f28744f..2bc7660 100755
--- a/run_project_tests.py
+++ b/run_project_tests.py
@@ -512,6 +512,21 @@ if __name__ == '__main__':
options = parser.parse_args()
setup_commands(options.backend)
+ # Appveyor sets the `platform` environment variable which completely messes
+ # up building with the vs2010 and vs2015 backends.
+ #
+ # Specifically, MSBuild reads the `platform` environment variable to set
+ # the configured value for the platform (Win32/x64/arm), which breaks x86
+ # builds.
+ #
+ # Appveyor setting this also breaks our 'native build arch' detection for
+ # Windows in environment.py:detect_windows_arch() by overwriting the value
+ # of `platform` set by vcvarsall.bat.
+ #
+ # While building for x86, `platform` should be unset.
+ if 'APPVEYOR' in os.environ and os.environ['arch'] == 'x86':
+ os.environ.pop('platform')
+
script_dir = os.path.split(__file__)[0]
if script_dir != '':
os.chdir(script_dir)