Skip to content

Commit

Permalink
more attempts to fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
CamJN committed Jul 27, 2024
1 parent dbf0676 commit 870d333
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ jobs:
GIT_AUTHOR_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
GIT_COMMITTER_NAME: github-actions[bot]
GIT_COMMITTER_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
MACOS_VER_NUM: 14
MACOS_VER_NUM: 14.0
CERT_IDENTITY: me
LDLIBS: -lgetargv
CXXFLAGS: -Iinclude
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ $(DMG): $(PRODUCT)

$(DISTRIBUTION): $(SRC_DIR)/dist.xml
< $< > $@ sed \
-e 's/OS_VERSION/$(MACOS_VER_NUM)/g' \
-e 's/OS_VERSION/$(MACOSX_DEPLOYMENT_TARGET)/g' \
-e 's/ARCH/$(ARCH)/g' \
-e 's/VERSION/$(VERSION)/g' \
-e 's/LIB_PKG_NAME/$(LIB_PKG:$(PKG_DIR)/%=%)/g' \
Expand Down
56 changes: 26 additions & 30 deletions Makefile-variables
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
PREFIX ?= /usr/local
ifndef MACOS_VER_NUM
MACOS_VER_NUM := $(shell vtool -show-build $(shell pkg-config --variable=libdir getargv)/libgetargv.dylib | awk '/minos/{print $$2}')
endif
PREFIX ?= /usr/local
MACOS_VER_NUM ?= $(shell vtool -show-build $(shell pkg-config --variable=libdir getargv)/libgetargv.dylib | awk '/minos/{print $$2}')
MACOS_VER_MAJOR := $(shell echo $(MACOS_VER_NUM) | cut -f1 -d.)
MACOS_VER_MINOR := $(shell echo $(MACOS_VER_NUM) | cut -f2 -d.)
MACOS_LT_10_11 := $(shell [ $(MACOS_VER_MAJOR) -eq 10 -a $(MACOS_VER_MINOR) -lt 11 ] && echo true)
Expand All @@ -12,53 +10,51 @@ export MACOSX_DEPLOYMENT_TARGET := $(MACOS_VER_MAJOR).$(MACOS_VER_MINOR)
# When changing version, also change: getargv++.pc, doxygen.conf, and README.md
VERSION=0.9
#
COMPAT_VERSION := $(shell echo $(VERSION) | cut -f1 -d.).0
ARCH := $(shell uname -m)
COMPAT_VERSION := $(shell echo $(VERSION) | cut -f1 -d.).0
ARCH := $(shell uname -m)
CODESIGN_PREFIX := cam.narzt.
KEYCHAIN := ~/Library/Keychains/login.keychain-db
ifndef CERT_IDENTITY
CERT_IDENTITY := $(shell security find-identity -v -p codesigning | sed -Ee 's/.*"([^"]+)".*/\1/g' | grep -Fve ' valid identit' -e ' CA')
endif
CERT_IDENTITY ?= $(shell security find-identity -v -p codesigning | sed -Ee 's/.*"([^"]+)".*/\1/g' | grep -Fve ' valid identit' -e ' CA')

SRC_DIR = src
INCLUDE_DIR = include
OBJ_DIR = obj
LIB_DIR = lib
PKG_DIR = pkg
FAKE_ROOT = fakeroot
CXX = clang++
CPPFLAGS := -MMD -MP
SRC_DIR := src
INCLUDE_DIR := include
OBJ_DIR := obj
LIB_DIR := lib
PKG_DIR := pkg
FAKE_ROOT := fakeroot
CXX := clang++
CPPFLAGS := -MMD -MP

COMPILER_VERSION := $(shell $(CXX) --version | grep version | grep -o -m 1 "[0-9]\+\.[0-9]\+\.*[0-9]*" | head -n 1)
COMPILER_VERSION_NUMBER := $(shell echo $(COMPILER_VERSION) | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$$/&00/')
CLANG_13_OR_MORE := $(shell expr $(COMPILER_VERSION_NUMBER) \>= 130106)
ifneq ($(CLANG_13_OR_MORE),0)
# supported: c++11, c++14, c++17, c++20
# future: c++2b
CXXFLAGS := --std=c++20 -O3 -Iinclude $(shell pkg-config --cflags getargv)
CXXFLAGS ?= --std=c++20 -O3 -Iinclude $(shell pkg-config --cflags getargv)
else
CXXFLAGS := --std=c++17 -O3 -Iinclude $(shell pkg-config --cflags getargv)
CXXFLAGS ?= --std=c++17 -O3 -Iinclude $(shell pkg-config --cflags getargv)
endif

EXTRA_CXXFLAGS := -pedantic-errors -Weverything -Wno-c++98-compat -Wno-pre-c++20-compat-pedantic -Wno-poison-system-directories
LDFLAGS := -Llib -fvisibility=default -fPIC
LDLIBS := $(shell pkg-config --libs getargv)
LDFLAGS := -Llib -fvisibility=default -fPIC
LDLIBS ?= $(shell pkg-config --libs getargv)

LIB_SHORT_NAME = getargv++
LIB_NAME = lib$(LIB_SHORT_NAME)
DYLIB_FILENAME = $(LIB_NAME).$(VERSION).dylib
DYLIB = lib/$(DYLIB_FILENAME)
SOURCES = $(wildcard $(SRC_DIR)/*.cpp)
HEADERS = $(wildcard $(INCLUDE_DIR)/*.hpp)
OBJECTS = $(SOURCES:$(SRC_DIR)/%.cpp=$(OBJ_DIR)/%.o)
LIB_SHORT_NAME := getargv++
LIB_NAME := lib$(LIB_SHORT_NAME)
DYLIB_FILENAME := $(LIB_NAME).$(VERSION).dylib
DYLIB := lib/$(DYLIB_FILENAME)
SOURCES := $(wildcard $(SRC_DIR)/*.cpp)
HEADERS := $(wildcard $(INCLUDE_DIR)/*.hpp)
OBJECTS := $(SOURCES:$(SRC_DIR)/%.cpp=$(OBJ_DIR)/%.o)

DMG_VOLUME_NAME := $(LIB_NAME) Installer
DMG := $(PKG_DIR)/$(LIB_NAME).dmg
PRODUCT_BUNDLE_PACKAGE_TYPE := APPL
LIB_BUNDLE_IDENTIFIER := $(CODESIGN_PREFIX)$(LIB_NAME)
PRODUCT_BUNDLE_IDENTIFIER := $(LIB_BUNDLE_IDENTIFIER)
PRODUCT := $(PKG_DIR)/$(LIB_NAME)-$(VERSION)-macOS-$(MACOS_VER_NUM)-$(ARCH).pkg
LIB_PKG := $(PKG_DIR)/$(LIB_NAME)-$(VERSION)-macOS-$(MACOS_VER_NUM)-$(ARCH)-package.pkg
PRODUCT := $(PKG_DIR)/$(LIB_NAME)-$(VERSION)-macOS-$(MACOSX_DEPLOYMENT_TARGET)-$(ARCH).pkg
LIB_PKG := $(PKG_DIR)/$(LIB_NAME)-$(VERSION)-macOS-$(MACOSX_DEPLOYMENT_TARGET)-$(ARCH)-package.pkg
DISTRIBUTION := $(OBJ_DIR)/dist.xml

ifeq ($(MACOS_LT_10_11),true)
Expand Down

0 comments on commit 870d333

Please sign in to comment.