mk: C++17

This commit is contained in:
Junxiao Shi committed 2022-03-12 17:39:38 +00:00
1 parent 3226bdce4a
commit 2159092133
2 files changed
+22 -9

No files matched your search

+9 -5
View File
@@ -1,5 +1,8 @@
name: build name: build
on: [push, pull_request] on:
push:
pull_request:
workflow_dispatch:
jobs: jobs:
build: build:
@@ -8,18 +11,19 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: install dependencies - name: install dependencies
run: | run: |
sudo apt-get install libboost-dev libboost-program-options-dev sudo apt-get install -y --no-install-recommends libboost-dev libboost-program-options-dev
- name: check code style - name: check code style
run: | run: |
make lint make lint
[[ $(git status --porcelain | tee >(cat 1>&2) | wc -l) -eq 0 ]] git diff --exit-code
- name: build and install - name: build and install
run: | run: |
make make
sudo make install sudo make install
sudo make uninstall
debian: debian:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
container: debian:buster container: debian:bullseye
steps: steps:
- name: install tools - name: install tools
run: | run: |
@@ -33,7 +37,7 @@ jobs:
run: | run: |
debian/nightly-changelog.sh debian/nightly-changelog.sh
env: env:
DISTRO: buster DISTRO: bullseye
- name: build package - name: build package
run: | run: |
debuild -us -uc debuild -us -uc
+13 -4
View File
@@ -1,23 +1,32 @@
CXX ?= g++ CXX ?= g++
CXXFLAGS ?= -std=c++17 -Wall -Werror -Wno-error=deprecated-declarations -O2
PREFIX ?= /usr/local PREFIX ?= /usr/local
DESTDIR ?= DESTDIR ?=
.PHONY: all
all: infoconv infoedit all: infoconv infoedit
infoconv: infoconv.cpp infoconv: infoconv.cpp
$(CXX) -o infoconv -std=c++11 infoconv.cpp $(CXX) $(CXXFLAGS) -o $@ $<
infoedit: infoedit.hpp infoedit.cpp infoedit: infoedit.cpp infoedit.hpp
$(CXX) -o infoedit -std=c++11 infoedit.cpp -lboost_program_options $(CXX) $(CXXFLAGS) -o $@ $< -lboost_program_options
.PHONY: lint
lint: lint:
clang-format-8 -i -style=file *.[hc]pp clang-format-11 -i -style=file *.[hc]pp
.PHONY: clean
clean:
rm -f infoconv infoedit
.PHONY: install
install: infoconv infoedit install: infoconv infoedit
install -d $(DESTDIR)$(PREFIX)/bin install -d $(DESTDIR)$(PREFIX)/bin
install infoconv $(DESTDIR)$(PREFIX)/bin/infoconv install infoconv $(DESTDIR)$(PREFIX)/bin/infoconv
install infoedit $(DESTDIR)$(PREFIX)/bin/infoedit install infoedit $(DESTDIR)$(PREFIX)/bin/infoedit
.PHONY: uninstall
uninstall: uninstall:
rm $(DESTDIR)$(PREFIX)/bin/infoconv rm $(DESTDIR)$(PREFIX)/bin/infoconv
rm $(DESTDIR)$(PREFIX)/bin/infoedit rm $(DESTDIR)$(PREFIX)/bin/infoedit