From d7ae8b734a50144290a5b50ca3a84bcf7753c69a Mon Sep 17 00:00:00 2001 From: Slava <20563034+veaceslavdoina@users.noreply.github.com> Date: Sat, 9 Nov 2024 13:39:39 +0200 Subject: [PATCH] makefile: Use do not use -mssse3 instructions on arm (#940) (#990) --- Makefile | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3340fd10..7c8f2b1a 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,28 @@ DOCKER_IMAGE_NIM_PARAMS ?= -d:chronicles_colors:none -d:insecure LINK_PCRE := 0 -CXXFLAGS ?= -std=c++17 -mssse3 +ifeq ($(OS),Windows_NT) + ifeq ($(PROCESSOR_ARCHITECTURE), AMD64) + ARCH = x86_64 + endif + ifeq ($(PROCESSOR_ARCHITECTURE), ARM64) + ARCH = arm64 + endif +else + UNAME_P := $(shell uname -p) + ifneq ($(filter $(UNAME_P), i686 i386 x86_64),) + ARCH = x86_64 + endif + ifneq ($(filter $(UNAME_P), aarch64 arm),) + ARCH = arm64 + endif +endif + +ifeq ($(ARCH), x86_64) + CXXFLAGS ?= -std=c++17 -mssse3 +else + CXXFLAGS ?= -std=c++17 +endif export CXXFLAGS # we don't want an error here, so we can handle things later, in the ".DEFAULT" target