Skip to content

Commit

Permalink
use -xc++ when building with C++
Browse files Browse the repository at this point in the history
  • Loading branch information
pmqs committed Jun 17, 2024
1 parent f7d1764 commit da8e6b7
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 18 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ jobs:
- 0
- 1

cc-opts:
- -Werror
- -Werror -Wc++-compat
ccflags:
- -Werror
- -Werror -Wc++-compat

name: Perl ${{ matrix.perl }} BUILD_ZLIB:${{matrix.build-zlib}} ${{matrix.cc-opts}}
name: Perl ${{ matrix.perl }} BUILD_ZLIB:${{matrix.build-zlib}} CCFLAGS:${{matrix.ccflags}}
steps:
- uses: actions/checkout@v4

Expand All @@ -58,7 +58,7 @@ jobs:
- name: Build
run: |
flags=$( perl -MConfig -e 'print $Config::Config{ccflags}' )
perl Makefile.PL CCFLAGS="$flags ${{matrix.cc-opts}}" && make
perl Makefile.PL CCFLAGS="$flags ${{matrix.ccflags}}" && make
env:
BUILD_ZLIB: ${{matrix.build-zlib}}

Expand All @@ -77,14 +77,17 @@ jobs:
- latest

compiler:
- gcc
- g++
- name: gcc
ccflags: -Werror

- name: g++
ccflags: -Werror -xc++

build-zlib:
- 0
- 1

name: Perl ${{ matrix.perl }} BUILD_ZLIB:${{matrix.build-zlib}} ${{matrix.compiler}}
name: Perl ${{ matrix.perl }} BUILD_ZLIB:${{matrix.build-zlib}} ${{matrix.compiler.name}}
steps:
- uses: actions/checkout@v4

Expand All @@ -102,7 +105,7 @@ jobs:
- name: Build
run: |
flags=$( perl -MConfig -e 'print $Config::Config{ccflags}' )
perl Makefile.PL CCFLAGS="$flags -Werror" CC=${{matrix.compiler}} && make
perl Makefile.PL CCFLAGS="$flags ${{ matrix.compiler.ccflags}}" CC=${{matrix.compiler.name}} && make
env:
BUILD_ZLIB: ${{matrix.build-zlib}}

Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,16 @@ jobs:
- '5.10'
- '5.8'
- '5.6'

ccflags:
- -Werror
- -Werror -Wc++-compat

build-zlib:
- 0
- 1

name: Perl ${{ matrix.perl }} BUILD_ZLIB:${{matrix.build-zlib}}
name: Perl ${{ matrix.perl }} BUILD_ZLIB:${{matrix.build-zlib}} CCFLAGS:${{matrix.ccflags}}
steps:
- uses: actions/checkout@v4

Expand All @@ -51,7 +56,9 @@ jobs:
run: cpanm --quiet --installdeps --notest .

- name: Build
run: perl Makefile.PL && make
run: |
flags=$( perl -MConfig -e 'print $Config::Config{ccflags}' )
perl Makefile.PL CCFLAGS="$flags ${{matrix.ccflags}}" && make
env:
BUILD_ZLIB: ${{matrix.build-zlib}}

Expand All @@ -71,10 +78,10 @@ jobs:

compiler:
- name: clang
werror: -Werror
ccflags: -Werror

- name: clang++
werror: -Werror -Wno-error=deprecated
ccflags: -Werror -xc++

build-zlib:
- 0
Expand All @@ -98,7 +105,7 @@ jobs:
- name: Build
run: |
flags=$( perl -MConfig -e 'print $Config::Config{ccflags}' )
perl Makefile.PL CCFLAGS="$flags ${{matrix.compiler.werror}} " CC=${{matrix.compiler.name}} && make
perl Makefile.PL CCFLAGS="$flags ${{matrix.compiler.ccflags}} " CC=${{matrix.compiler.name}} && make
env:
BUILD_ZLIB: ${{matrix.build-zlib}}

Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,17 @@ jobs:
- latest

compiler:
- gcc
- g++
- name: gcc
ccflags: -Werror

- name: g++
ccflags: -Werror -xc++

build-zlib:
- 0
- 1

name: Perl ${{ matrix.perl }} BUILD_ZLIB:${{matrix.build-zlib}} ${{matrix.compiler}}
name: Perl ${{ matrix.perl }} BUILD_ZLIB:${{matrix.build-zlib}} ${{matrix.compiler.name}}
steps:
- uses: actions/checkout@v4

Expand All @@ -97,7 +100,7 @@ jobs:
- name: Build
run: |
flags=$( perl -MConfig -e 'print $Config::Config{ccflags}' )
perl Makefile.PL CCFLAGS="$flags -Werror" CC=${{matrix.compiler}} && make
perl Makefile.PL CCFLAGS="$flags ${{matrix.compiler.ccflags}}" CC=${{matrix.compiler.name}} && make
env:
BUILD_ZLIB: ${{matrix.build-zlib}}

Expand Down

0 comments on commit da8e6b7

Please sign in to comment.