From 35611c33a3ae8ff91f4507b12872edec1dd70374 Mon Sep 17 00:00:00 2001 From: "John M. Penn" Date: Mon, 3 Mar 2025 14:53:07 -0600 Subject: [PATCH 1/3] Update testing build to use C++14 which is required for gtest. --- trick_source/sim_services/DataTypes/testing/makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/trick_source/sim_services/DataTypes/testing/makefile b/trick_source/sim_services/DataTypes/testing/makefile index ec78b03c..b2e09de5 100644 --- a/trick_source/sim_services/DataTypes/testing/makefile +++ b/trick_source/sim_services/DataTypes/testing/makefile @@ -1,13 +1,13 @@ RM = rm -rf CC = cc -CPP = c++ +CPP = /usr/bin/g++ DECL_DIR = .. -GTEST_HOME = /usr/local +GTEST_HOME = /opt/homebrew -CFLAGS += -g -Wall -Wextra -I$(GTEST_HOME)/include -I$(DECL_DIR)/include +CFLAGS += -std=c++14 -g -Wall -Wextra -I$(GTEST_HOME)/include -I$(DECL_DIR)/include LIBS = -L${DECL_DIR}/lib -lDecl -L${GTEST_HOME}/lib -lgtest -lgtest_main -lpthread From 4a9e21607a1d91d69f7e3f867182f365882d970d Mon Sep 17 00:00:00 2001 From: "John M. Penn" Date: Tue, 4 Mar 2025 10:24:59 -0600 Subject: [PATCH 2/3] Set GTEST_HOME based on OS. --- trick_source/sim_services/DataTypes/testing/makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/trick_source/sim_services/DataTypes/testing/makefile b/trick_source/sim_services/DataTypes/testing/makefile index b2e09de5..a7a3eb8b 100644 --- a/trick_source/sim_services/DataTypes/testing/makefile +++ b/trick_source/sim_services/DataTypes/testing/makefile @@ -5,7 +5,12 @@ CPP = /usr/bin/g++ DECL_DIR = .. -GTEST_HOME = /opt/homebrew +UNAME_S = $(shell uname -s) +ifeq ($(UNAME_S),Darwin) + GTEST_HOME=/opt/homebrew +else + GTEST_HOME=/usr/local +endif CFLAGS += -std=c++14 -g -Wall -Wextra -I$(GTEST_HOME)/include -I$(DECL_DIR)/include From 773d9814e73bd90fd35c7f2d9282265fe37ce956 Mon Sep 17 00:00:00 2001 From: "John M. Penn" Date: Tue, 4 Mar 2025 10:57:39 -0600 Subject: [PATCH 3/3] GTEST_HOME is /opt/homebrew only for Darwin,Arm. Everything else uses GTEST_HOME = /usr/local. --- trick_source/sim_services/DataTypes/testing/makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/trick_source/sim_services/DataTypes/testing/makefile b/trick_source/sim_services/DataTypes/testing/makefile index a7a3eb8b..c6ed1bb7 100644 --- a/trick_source/sim_services/DataTypes/testing/makefile +++ b/trick_source/sim_services/DataTypes/testing/makefile @@ -5,11 +5,13 @@ CPP = /usr/bin/g++ DECL_DIR = .. +GTEST_HOME=/usr/local UNAME_S = $(shell uname -s) +UNAME_M = $(shell uname -m) ifeq ($(UNAME_S),Darwin) - GTEST_HOME=/opt/homebrew -else - GTEST_HOME=/usr/local + ifeq ($(UNAME_M),arm64) + GTEST_HOME=/opt/homebrew + endif endif CFLAGS += -std=c++14 -g -Wall -Wextra -I$(GTEST_HOME)/include -I$(DECL_DIR)/include