Skip to content

Commit

Permalink
fix: make std c++17
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Dec 11, 2020
1 parent d936b19 commit 0a7daa7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ jobs:
path: node_modules
key: ${{ runner.os }}-${{ matrix.node_version }}-${{ matrix.node_arch }}-${{ hashFiles('package.json') }}

- name: Install Compiler for Ubuntu 16.04
if: ${{ contains(matrix.os, 'ubuntu-16.04') }}
run: |
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-9 10
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 10
sudo update-alternatives --config clang
sudo update-alternatives --config clang++
- name: Set Compiler for Ubuntu
run: |
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
# - name: Install Compiler for Ubuntu 16.04
# if: ${{ contains(matrix.os, 'ubuntu-16.04') }}
# run: |
# sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
# sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-9 10
# sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 10
# sudo update-alternatives --config clang
# sudo update-alternatives --config clang++
# - name: Set Compiler for Ubuntu
# run: |
# echo "CC=clang" >> $GITHUB_ENV
# echo "CXX=clang++" >> $GITHUB_ENV

- name: Install Node
uses: actions/[email protected]
Expand Down
8 changes: 4 additions & 4 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
'Release': {
'defines': [ 'NAPI_DISABLE_CPP_EXCEPTIONS', 'NDEBUG' ],
"cflags": [ "-fno-exceptions", "-Ofast" ],
"cflags_cc": [ "-fno-exceptions", "-Ofast", "-std=c++2a", "-stdlib=libc++" ],
"cflags_cc": [ "-fno-exceptions", "-Ofast", "-std=c++17" ],
"xcode_settings": {
'GCC_OPTIMIZATION_LEVEL': '3', # stop gyp from defaulting to -Os
"CLANG_CXX_LIBRARY": "libc++",
"CLANG_CXX_LANGUAGE_STANDARD":"c++2a",
"CLANG_CXX_LANGUAGE_STANDARD":"c++17",
'MACOSX_DEPLOYMENT_TARGET': '10.15'
},
"msvs_settings": {
Expand Down Expand Up @@ -50,7 +50,7 @@
'-fexceptions', # enable exceptions

# C++ standard
"-std=c++2a",
"-std=c++17",
"-stdlib=libc++",

# Clang warnings
Expand Down Expand Up @@ -108,7 +108,7 @@
'GCC_OPTIMIZATION_LEVEL': '0', # stop gyp from defaulting to -Os
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
"CLANG_CXX_LIBRARY": "libc++",
"CLANG_CXX_LANGUAGE_STANDARD":"c++2a",
"CLANG_CXX_LANGUAGE_STANDARD":"c++17",
'MACOSX_DEPLOYMENT_TARGET': '10.15'
} # XCODE
}, # Debug
Expand Down

0 comments on commit 0a7daa7

Please sign in to comment.