From c7fa47b96d905b71c2bedbd4602a4cb7cc8ac56e Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Mon, 20 Nov 2023 15:49:48 -0800 Subject: [PATCH] Set CXXFLAGS as well as CFLAGS in CI builds & enable C++11 Enable C++11 mode on macOS 12 builds, which is needed to compile exiv 0.28.1 headers. --- .appveyor.yml | 4 ++-- .cirrus.yml | 6 +++--- .github/workflows/ci.yml | 20 ++++++++++++-------- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 8fa7379..07f5aa7 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -17,9 +17,9 @@ install: build_script: - cmd: if [%CONFIG%]==[cygwin64] ( - C:\%CONFIG%\bin\bash -e -l -c "cd $APPVEYOR_BUILD_FOLDER && make gpscorrelate gpscorrelate-gui CFLAGS='-Wall -Wextra -O3 -DENABLE_NLS' LDFLAGS='-lintl'" ) + C:\%CONFIG%\bin\bash -e -l -c "cd $APPVEYOR_BUILD_FOLDER && make gpscorrelate gpscorrelate-gui CXXFLAGS='-Wall -Wextra -O3 -DENABLE_NLS' CFLAGS='-Wall -Wextra -O3 -DENABLE_NLS' LDFLAGS='-lintl'" ) - cmd: if [%CONFIG%]==[msys2] ( - make EXEEXT=.exe gpscorrelate.exe gpscorrelate-gui.exe CC=gcc CXX=g++ CFLAGS="-Wall -Wextra -O3 -DENABLE_NLS" LDFLAGS="-lintl" ) + make EXEEXT=.exe gpscorrelate.exe gpscorrelate-gui.exe CC=gcc CXX=g++ CFLAGS="-Wall -Wextra -O3 -DENABLE_NLS" CXXFLAGS="-Wall -Wextra -O3 -DENABLE_NLS" LDFLAGS="-lintl" ) test_script: # Cygwin allows overwriting read-only files for some strange reason, which diff --git a/.cirrus.yml b/.cirrus.yml index e23e4eb..cd2ec00 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -29,7 +29,7 @@ freebsd_task: - pkg install -y pkgconf docbook-xsl exiv2 libxml2 gtk"$GTK" libxslt gettext-tools desktop-file-utils compile_script: - - make CC="$CC" CXX="$CXX" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" GTK="$GTK" + - make CC="$CC" CXX="$CXX" CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" GTK="$GTK" test_script: - ./gpscorrelate -V @@ -70,7 +70,7 @@ linux_arm_task: - adduser build compile_script: - - make CC="$CC" CXX="$CXX" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" GTK="$GTK" + - make CC="$CC" CXX="$CXX" CFLAGS="$CFLAGS" CFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" GTK="$GTK" test_script: - ./gpscorrelate -V @@ -113,7 +113,7 @@ linux_musl_task: - adduser -D build compile_script: - - make CC="$CC" CXX="$CXX" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" GTK="$GTK" + - make CC="$CC" CXX="$CXX" CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" GTK="$GTK" test_script: - ./gpscorrelate -V diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7178669..7fcf8c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: - name: 'install deps' run: sudo apt-get update -y; sudo apt-get install -y --no-install-suggests --no-install-recommends ${{ matrix.build.install }} - name: 'build' - run: make CFLAGS="${{ matrix.build.cflags }}" LDFLAGS="${{ matrix.build.ldflags }}" CC="${{ matrix.build.cc }}" CXX="${{ matrix.build.cxx }}" GTK="${{ matrix.build.gtk }}" ${{ matrix.build.make_opts }} ${{ matrix.build.target }} + run: make CFLAGS="${{ matrix.build.cflags }}" CXXFLAGS="${{ matrix.build.cflags }}" LDFLAGS="${{ matrix.build.ldflags }}" CC="${{ matrix.build.cc }}" CXX="${{ matrix.build.cxx }}" GTK="${{ matrix.build.gtk }}" ${{ matrix.build.make_opts }} ${{ matrix.build.target }} - name: 'smoke test' # ASAN_OPTIONS is to work around https://bugzilla.redhat.com/show_bug.cgi?id=1950244 run: env ASAN_OPTIONS="${{ matrix.build.asan_options }}" ./gpscorrelate -V @@ -203,7 +203,7 @@ jobs: - name: 'install deps' run: sudo apt-get update -y; sudo apt-get install -y --no-install-suggests --no-install-recommends ${{ matrix.build.install }} - name: 'build' - run: make CFLAGS="${{ matrix.build.cflags }}" LDFLAGS="${{ matrix.build.ldflags }}" CC="${{ matrix.build.cc }}" CXX="${{ matrix.build.cxx }}" GTK="${{ matrix.build.gtk }}" ${{ matrix.build.make_opts }} ${{ matrix.build.target }} + run: make CFLAGS="${{ matrix.build.cflags }}" CXXFLAGS="${{ matrix.build.cflags }}"LDFLAGS="${{ matrix.build.ldflags }}" CC="${{ matrix.build.cc }}" CXX="${{ matrix.build.cxx }}" GTK="${{ matrix.build.gtk }}" ${{ matrix.build.make_opts }} ${{ matrix.build.target }} - name: 'smoke test' run: ./gpscorrelate -V - name: 'test' @@ -236,7 +236,7 @@ jobs: - name: 'install deps' run: sudo apt-get update -y; sudo apt-get install -y --no-install-suggests --no-install-recommends ${{ matrix.build.install }} - name: 'build' - run: make CFLAGS="${{ matrix.build.cflags }}" LDFLAGS="${{ matrix.build.ldflags }}" CC="${{ matrix.build.cc }}" CXX="${{ matrix.build.cxx }}" GTK="${{ matrix.build.gtk }}" ${{ matrix.build.make_opts }} ${{ matrix.build.target }} + run: make CFLAGS="${{ matrix.build.cflags }}" CXXFLAGS="${{ matrix.build.cflags }}" LDFLAGS="${{ matrix.build.ldflags }}" CC="${{ matrix.build.cc }}" CXX="${{ matrix.build.cxx }}" GTK="${{ matrix.build.gtk }}" ${{ matrix.build.make_opts }} ${{ matrix.build.target }} - name: 'smoke test' run: ./gpscorrelate -V - name: 'test' @@ -260,14 +260,16 @@ jobs: gtk: 2 install: desktop-file-utils docbook-xsl exiv2 gtk+ cflags: -Wall -Wextra -Werror -Wno-error=deprecated-declarations -O3 -DENABLE_NLS=1 + cxxflags: -std=c++11 -Wall -Wextra -Werror -Wno-error=deprecated-declarations -O3 -DENABLE_NLS=1 ldflags: -O3 -lintl cxx: g++ target: all install_target: install install-po install-desktop-file - cc: gcc gtk: 3 - install: desktop-file-utils docbook-xsl exiv2 gtk+3 + install: -std=c++11 desktop-file-utils docbook-xsl exiv2 gtk+3 cflags: -Wall -Wextra -Werror -Wno-error=deprecated-declarations -O3 -DENABLE_NLS=1 + cxxflags: -std=c++11 -Wall -Wextra -Werror -Wno-error=deprecated-declarations -O3 -DENABLE_NLS=1 ldflags: -O3 -lintl cxx: g++ target: all @@ -276,6 +278,7 @@ jobs: gtk: 2 install: desktop-file-utils docbook-xsl exiv2 gtk+ cflags: -Wall -Wextra -Werror -Wno-error=deprecated-declarations -O3 -DENABLE_NLS=1 + cxxflags: -std=c++11 -Wall -Wextra -Werror -Wno-error=deprecated-declarations -O3 -DENABLE_NLS=1 ldflags: -O3 -lintl cxx: clang++ target: all @@ -284,6 +287,7 @@ jobs: gtk: 3 install: desktop-file-utils docbook-xsl exiv2 gtk+3 cflags: -Wall -Wextra -Werror -Wno-error=deprecated-declarations -O3 -DENABLE_NLS=1 + cxxflags: -std=c++11 -Wall -Wextra -Werror -Wno-error=deprecated-declarations -O3 -DENABLE_NLS=1 ldflags: -O3 -lintl cxx: clang++ target: all @@ -294,7 +298,7 @@ jobs: - name: install deps run: brew install ${{ matrix.build.install }} - name: build - run: make CFLAGS="${{ matrix.build.cflags }}" LDFLAGS="${{ matrix.build.ldflags }}" CC="${{ matrix.build.cc }}" CXX="${{ matrix.build.cxx }}" GTK="${{ matrix.build.gtk }}" ${{ matrix.build.make_opts }} XML_CATALOG_FILES="$(brew --prefix)/etc/xml/catalog" XSLTFLAGS=--nonet ${{ matrix.build.target }} + run: make CFLAGS="${{ matrix.build.cflags }}" CXXFLAGS="${{ matrix.build.cxxflags }}" LDFLAGS="${{ matrix.build.ldflags }}" CC="${{ matrix.build.cc }}" CXX="${{ matrix.build.cxx }}" GTK="${{ matrix.build.gtk }}" ${{ matrix.build.make_opts }} XML_CATALOG_FILES="$(brew --prefix)/etc/xml/catalog" XSLTFLAGS=--nonet ${{ matrix.build.target }} - name: smoke test run: ./gpscorrelate -V - name: test @@ -355,7 +359,7 @@ jobs: - name: install deps run: brew install ${{ matrix.build.install }} - name: build - run: make CFLAGS="${{ matrix.build.cflags }}" LDFLAGS="${{ matrix.build.ldflags }}" CC="${{ matrix.build.cc }}" CXX="${{ matrix.build.cxx }}" GTK="${{ matrix.build.gtk }}" ${{ matrix.build.make_opts }} XML_CATALOG_FILES="$(brew --prefix)/etc/xml/catalog" XSLTFLAGS=--nonet ${{ matrix.build.target }} + run: make CFLAGS="${{ matrix.build.cflags }}" CXXFLAGS="${{ matrix.build.cflags }}" LDFLAGS="${{ matrix.build.ldflags }}" CC="${{ matrix.build.cc }}" CXX="${{ matrix.build.cxx }}" GTK="${{ matrix.build.gtk }}" ${{ matrix.build.make_opts }} XML_CATALOG_FILES="$(brew --prefix)/etc/xml/catalog" XSLTFLAGS=--nonet ${{ matrix.build.target }} - name: smoke test run: ./gpscorrelate -V - name: test @@ -391,7 +395,7 @@ jobs: run: | dnf install -y --setopt=install_weak_deps=False ${{ matrix.build.install }} - name: build - run: make CFLAGS="${{ matrix.build.cflags }}" LDFLAGS="${{ matrix.build.ldflags }}" CC="${{ matrix.build.cc }}" CXX="${{ matrix.build.cxx }}" GTK="${{ matrix.build.gtk }}" ${{ matrix.build.make_opts }} ${{ matrix.build.target }} + run: make CFLAGS="${{ matrix.build.cflags }}" CXXFLAGS="${{ matrix.build.cflags }}" LDFLAGS="${{ matrix.build.ldflags }}" CC="${{ matrix.build.cc }}" CXX="${{ matrix.build.cxx }}" GTK="${{ matrix.build.gtk }}" ${{ matrix.build.make_opts }} ${{ matrix.build.target }} - name: smoke test run: ./gpscorrelate -V - name: test @@ -428,7 +432,7 @@ jobs: run: | dnf install -y --setopt=install_weak_deps=False ${{ matrix.build.install }} - name: build - run: make CFLAGS="${{ matrix.build.cflags }}" LDFLAGS="${{ matrix.build.ldflags }}" CC="${{ matrix.build.cc }}" CXX="${{ matrix.build.cxx }}" GTK="${{ matrix.build.gtk }}" ${{ matrix.build.make_opts }} ${{ matrix.build.target }} + run: make CFLAGS="${{ matrix.build.cflags }}" CXXFLAGS="${{ matrix.build.cflags }}" LDFLAGS="${{ matrix.build.ldflags }}" CC="${{ matrix.build.cc }}" CXX="${{ matrix.build.cxx }}" GTK="${{ matrix.build.gtk }}" ${{ matrix.build.make_opts }} ${{ matrix.build.target }} - name: smoke test run: ./gpscorrelate -V - name: test