fixed macos build by manually installing `pcre` (#4597)

* Makefile: bail out if `pcre-config` is missing

* CI-unixish.yml: install `pcre` for `macos` via `brew` since it suddenly disappeared from the runner images
This commit is contained in:
Oliver Stöneberg 2022-11-25 15:11:57 +01:00 committed by GitHub
parent c26a8fb4ce
commit 01abf4c347
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 9 deletions

View File

@ -39,7 +39,8 @@ jobs:
- name: Install missing software on macos
if: contains(matrix.os, 'macos')
run: |
brew install coreutils qt@5 tinyxml2
# pcre was removed from runner images in November 2022
brew install coreutils qt@5 tinyxml2 pcre
- name: CMake build on ubuntu (with GUI / system tinyxml2)
if: contains(matrix.os, 'ubuntu')
@ -88,7 +89,8 @@ jobs:
- name: Install missing software on macos
if: contains(matrix.os, 'macos')
run: |
brew install coreutils qt@5
# pcre was removed from runner images in November 2022
brew install coreutils qt@5 pcre
- name: CMake build on ubuntu (with GUI)
if: contains(matrix.os, 'ubuntu')
@ -330,7 +332,8 @@ jobs:
- name: Install missing software on macos
if: contains(matrix.os, 'macos')
run: |
brew install coreutils python3
# pcre was removed from runner images in November 2022
brew install coreutils python3 pcre
- name: Install missing Python packages
run: |

View File

@ -151,11 +151,15 @@ else ifeq ($(CXX), c++)
endif
ifeq ($(HAVE_RULES),yes)
override CXXFLAGS += -DHAVE_RULES -DTIXML_USE_STL $(shell pcre-config --cflags)
PCRE_CONFIG = $(shell which pcre-config)
ifeq ($(PCRE_CONFIG),)
$(error Did not find pcre-config)
endif
override CXXFLAGS += -DHAVE_RULES -DTIXML_USE_STL $(shell $(PCRE_CONFIG) --cflags)
ifdef LIBS
LIBS += $(shell pcre-config --libs)
LIBS += $(shell $(PCRE_CONFIG) --libs)
else
LIBS=$(shell pcre-config --libs)
LIBS=$(shell $(PCRE_CONFIG) --libs)
endif
endif

View File

@ -429,11 +429,15 @@ int main(int argc, char **argv)
<< "\n";
fout << "ifeq ($(HAVE_RULES),yes)\n"
<< " override CXXFLAGS += -DHAVE_RULES -DTIXML_USE_STL $(shell pcre-config --cflags)\n"
<< " PCRE_CONFIG = $(shell which pcre-config)\n"
<< " ifeq ($(PCRE_CONFIG),)\n"
<< " $(error Did not find pcre-config)\n"
<< " endif\n"
<< " override CXXFLAGS += -DHAVE_RULES -DTIXML_USE_STL $(shell $(PCRE_CONFIG) --cflags)\n"
<< " ifdef LIBS\n"
<< " LIBS += $(shell pcre-config --libs)\n"
<< " LIBS += $(shell $(PCRE_CONFIG) --libs)\n"
<< " else\n"
<< " LIBS=$(shell pcre-config --libs)\n"
<< " LIBS=$(shell $(PCRE_CONFIG) --libs)\n"
<< " endif\n"
<< "endif\n\n";