From e8d654ed0fe7988dc7986483429c6a5313b5de57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=98tefan=20Talpalaru?= Date: Sat, 16 Feb 2019 06:01:05 +0100 Subject: [PATCH] Windows: allow architecture override --- .appveyor.yml | 6 +++--- Makefile | 45 +++++++++++++++++++++++++++++++-------------- 2 files changed, 34 insertions(+), 17 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 85c62e98d..660b0aac9 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -48,12 +48,12 @@ build_script: - cd C:\projects\%APPVEYOR_PROJECT_SLUG% # speed up submodule cloning - git submodule update --init --recursive --depth 10 - - mingw32-make fetch-dlls - - mingw32-make -j2 nimbus + - mingw32-make ARCH_OVERRIDE=%PLATFORM% fetch-dlls + - mingw32-make -j2 ARCH_OVERRIDE=%PLATFORM% nimbus test_script: - build\nimbus.exe --help - - mingw32-make -j2 test + - mingw32-make -j2 ARCH_OVERRIDE=%PLATFORM% test deploy: off diff --git a/Makefile b/Makefile index 95e28a78f..6f25b7544 100644 --- a/Makefile +++ b/Makefile @@ -32,9 +32,16 @@ NIM_DIR := vendor/Nim #- Windows is a special case, as usual #- macOS is also a special case, with its "ln" not supporting "-r" ifeq ($(OS), Windows_NT) + # the AppVeyor 32-build is done on a 64-bit image, so we need to override the architecture detection + ifeq ($(ARCH_OVERRIDE), x86) + UCPU := ucpu=i686 + else + UCPU := + endif + BUILD_CSOURCES := \ - $(MAKE) myos=windows clean && \ - $(MAKE) myos=windows CC=gcc LD=gcc + $(MAKE) myos=windows $(UCPU) clean && \ + $(MAKE) myos=windows $(UCPU) CC=gcc LD=gcc EXE_SUFFIX := .exe else BUILD_CSOURCES := \ @@ -189,21 +196,31 @@ ifeq ($(OS), Windows_NT) SQLITE_ARCHIVE_32 := sqlite-dll-win32-x86-3240000.zip SQLITE_ARCHIVE_64 := sqlite-dll-win64-x64-3240000.zip - ifeq ($(PROCESSOR_ARCHITEW6432), AMD64) + # the AppVeyor 32-build is done on a 64-bit image, so we need to override the architecture detection + ifeq ($(ARCH_OVERRIDE), x86) + ARCH := x86 + else + ifeq ($(PROCESSOR_ARCHITEW6432), AMD64) + ARCH := x64 + else + ifeq ($(PROCESSOR_ARCHITECTURE), AMD64) + ARCH := x64 + endif + ifeq ($(PROCESSOR_ARCHITECTURE), x86) + ARCH := x86 + endif + endif + endif + + ifeq ($(ARCH), x86) + SQLITE_ARCHIVE := $(SQLITE_ARCHIVE_32) + SQLITE_SUFFIX := _32 + ROCKSDB_DIR := x86 + endif + ifeq ($(ARCH), x64) SQLITE_ARCHIVE := $(SQLITE_ARCHIVE_64) SQLITE_SUFFIX := _64 ROCKSDB_DIR := x64 - else - ifeq ($(PROCESSOR_ARCHITECTURE), AMD64) - SQLITE_ARCHIVE := $(SQLITE_ARCHIVE_64) - SQLITE_SUFFIX := _64 - ROCKSDB_DIR := x64 - endif - ifeq ($(PROCESSOR_ARCHITECTURE), x86) - SQLITE_ARCHIVE := $(SQLITE_ARCHIVE_32) - SQLITE_SUFFIX := _32 - ROCKSDB_DIR := x86 - endif endif SQLITE_URL := https://www.sqlite.org/2018/$(SQLITE_ARCHIVE)