From 999f5ec446bb6874699887abf1cd224a1db22f72 Mon Sep 17 00:00:00 2001 From: nodchip Date: Wed, 24 Jun 2020 00:47:34 +0900 Subject: [PATCH] =?UTF-8?q?COMP=3Dmsys2=E3=82=92=E6=8C=87=E5=AE=9A?= =?UTF-8?q?=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Makefile | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/src/Makefile b/src/Makefile index 33fc2c00..8b656da2 100644 --- a/src/Makefile +++ b/src/Makefile @@ -229,7 +229,6 @@ ifeq ($(COMP),mingw) CXXFLAGS += -Wextra -Wshadow LDFLAGS += -static endif -LDFLAGS += -static -Wl,-s ifeq ($(COMP),icc) comp=icc @@ -259,6 +258,28 @@ ifeq ($(COMP),clang) endif endif +ifeq ($(COMP),msys2) + comp=gcc + CXX=g++ + CXXFLAGS += -pedantic -Wextra -Wshadow + + ifeq ($(ARCH),armv7) + ifeq ($(OS),Android) + CXXFLAGS += -m$(bits) + LDFLAGS += -m$(bits) + endif + else + CXXFLAGS += -m$(bits) + LDFLAGS += -m$(bits) + endif + + ifneq ($(KERNEL),Darwin) + LDFLAGS += -Wl,--no-as-needed + endif + + LDFLAGS += -static -Wl,-s +endif + ifeq ($(comp),icc) profile_make = icc-profile-make profile_use = icc-profile-use @@ -357,7 +378,7 @@ endif ifeq ($(avx2),yes) CXXFLAGS += -DUSE_AVX2 - ifeq ($(comp),$(filter $(comp),gcc clang mingw)) + ifeq ($(comp),$(filter $(comp),gcc clang mingw msys2)) CXXFLAGS += -mavx2 endif endif @@ -365,7 +386,7 @@ endif ### 3.7 pext ifeq ($(pext),yes) CXXFLAGS += -DUSE_PEXT - ifeq ($(comp),$(filter $(comp),gcc clang mingw)) + ifeq ($(comp),$(filter $(comp),gcc clang mingw msys2)) CXXFLAGS += -mbmi2 endif endif @@ -375,7 +396,7 @@ endif ### needs access to the optimization flags. ifeq ($(optimize),yes) ifeq ($(debug), no) - ifeq ($(comp),$(filter $(comp),gcc clang)) + ifeq ($(comp),$(filter $(comp),gcc clang msys2)) CXXFLAGS += -flto LDFLAGS += $(CXXFLAGS) endif @@ -435,6 +456,7 @@ help: @echo "mingw > Gnu compiler with MinGW under Windows" @echo "clang > LLVM Clang compiler" @echo "icc > Intel compiler" + @echo "msys2 > MSYS2" @echo "" @echo "Simple examples. If you don't know what to do, you likely want to run: " @echo ""