Skip to content

Commit

Permalink
build, CI: C++17 standard is now required minimum
Browse files Browse the repository at this point in the history
- main reason is std::filesystem library to replace the platform
specific code and make features more cross-platform
- thus GCC9 is now required minimum
  • Loading branch information
ped7g committed Sep 21, 2024
1 parent 26acc10 commit 3729d65
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 21 deletions.
27 changes: 12 additions & 15 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
task:
name: Linux gcc 5/9/latest builds
name: Linux gcc 9/11/latest builds
skip: "changesIncludeOnly('docs/*')"
env:
CIRRUS_CLONE_DEPTH: 1
CIRRUS_CLONE_SUBMODULES: true
container:
matrix:
image: gcc:5
image: gcc:9
image: gcc:11
image: gcc:latest
cpu: 2
memory: 1G
gcc_version_script: gcc --version
build_script: make clean && make -j3
install_script: make install && make clean
## now try the built+installed sjasmplus with some tests and examples
Expand Down Expand Up @@ -41,9 +42,7 @@ pipe:
cpu: 2
memory: 1G
steps:
# demoted back to gcc6 because gcov+lcov in gcc:8 and 9 image seems to produce a bit damaged coverage results?
# (I didn't dig into the issue, just trying to change version back to where it works well)
- image: gcc:6
- image: gcc:11
generate_gcov_script: make clean && make -j3 coverage
- image: python:3.7
# installing my patched version of "cpp-coveralls" to get support for CI_SERVICE_NAME and git-revision number
Expand Down Expand Up @@ -121,15 +120,13 @@ task:
CIRRUS_CLONE_DEPTH: 1
CIRRUS_CLONE_SUBMODULES: true
macos_instance:
#image: big-sur-base
image: ghcr.io/cirruslabs/macos-monterey-base:latest
#sw_versions2_script:
#- git --version || echo "no git"
#- bash --version || echo "no bash"
#- make --version || echo "no make"
#- cc --version || echo "no cc"
#- c++ --version || echo "no c++"
build_script:
image: ghcr.io/cirruslabs/macos-sonoma-base:latest
sw_versions2_script:
- git --version || echo "no git"
- bash --version || echo "no bash"
- make --version || echo "no make"
- cc --version || echo "no cc"
- c++ --version || echo "no c++"
- date
- make clean && make -j10 CC=cc CXX=c++
build_script: make clean && make -j10 CC=cc CXX=c++
test_script: make clean && make -j10 CC=cc CXX=c++ tests
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ set(SOURCES
add_definitions(-DMAX_PATH=PATH_MAX)
add_definitions(-DCMAKE)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS ON)
set(CMAKE_CXX_EXTENSIONS OFF)

set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -pedantic")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -pedantic")
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ or
- complete MinGW environment for MS Windows, configured with MinGW bin directories added in `PATH` variable (typically `C:\MinGW\bin;` `C:\MinGW\msys\1.0\bin`) or possibly with any BASH emulator (e.g. the one which comes with [git for windows](https://gitforwindows.org/)) will do it instead of msys is missing / not set.
- CMake installed into MinGW bin directory (optionally)

Compilation is tested with GCC 5.5.0, it should run also with older 5.x versions. It will not work with GCC 4.x and older.
C++17 standard is required, compilation is tested with GCC 9.5.0, it should run also with older 9.x versions. It will not work with GCC 8.x and older. C++17 is required since v1.21.0, older versions required C++14 and can be built with GCC 5.x.

## Getting full source code of sjasmplus

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# make tests - to run the CI test+example script runner
# make memcheck TEST=misc DEBUG=1 - to use valgrind on assembling sub-directory "misc" in tests
# make PREFIX=~/.local install - to install release version into ~/.local/bin/
# make clean && make CC=gcc-8 CXX=g++-8 - to compile binary with gcc-8
# make clean && make CC=gcc-9 CXX=g++-9 - to compile binary with gcc-9
# make DEBUG=1 LUA_COVERAGE=1 coverage - to produce build/debug/coverage/* files by running the tests
# make COVERALLS_SERVICE=1 DEBUG=1 coverage - to produce coverage data and upload them to https://coveralls.io/
# make CFLAGS_EXTRA='-m32' LDFLAGS='-ldl -m32' - to builds 32b linux executable
Expand Down Expand Up @@ -103,7 +103,7 @@ CFLAGS+=-DNDEBUG -O2
endif

# C++ flags (the CPPFLAGS are for preprocessor BTW, if you always wonder, like me...)
CXXFLAGS?=-std=gnu++14 $(CFLAGS)
CXXFLAGS?=-std=c++17 $(CFLAGS)

# full path to executable
BUILD_EXE=$(BUILD_DIR)/$(EXE_BASE_NAME)
Expand Down
2 changes: 1 addition & 1 deletion Makefile.win
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ SUBDIR_CRC32C=crc32c

# Ped7g: -pedantic removed due to Lua5.4 having too many warnings
CFLAGS=-DNDEBUG -O2 -Wall -static -DUSE_LUA -DMAX_PATH=PATH_MAX -I$(SUBDIR_LUA) -I$(SUBDIR_LUABRIDGE) -I$(SUBDIR_CRC32C)
CXXFLAGS=-std=gnu++14 $(CFLAGS)
CXXFLAGS=-std=c++17 $(CFLAGS)

LDFLAGS= -s

Expand Down
1 change: 1 addition & 0 deletions docs/documentation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@

<listitem>
<synopsis>
- C++17 standard is now required minimum (to compile sjasmplus sources) (GCC9 for example)
- <link linkend="po_incbin">`INCBIN`</link>, <link linkend="po_inchob">`INCHOB`</link> and <link linkend="po_inctrd">`INCTRD`</link> support now include paths priority (angle &lt;filename&gt; vs "filename")
- include paths which can't be opened before assembling are now reported in error message
- include paths which start with literal tilde '~' are reported in error message
Expand Down

0 comments on commit 3729d65

Please sign in to comment.