Skip to content

Commit

Permalink
Merge branch 'master' into hash
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkelfj committed Oct 24, 2023
2 parents 5f5155c + 0e925e1 commit ba7fb17
Show file tree
Hide file tree
Showing 33 changed files with 572 additions and 133 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CI

on: [push, pull_request]

env:
CTEST_OUTPUT_ON_FAILURE: 1

jobs:
ubuntu-ninja-clang:
name: Ubuntu (ninja, clang)
runs-on: ubuntu-22.04
steps:
- name: Prepare
run: |
sudo apt update
sudo apt install ninja-build
- uses: actions/checkout@v3
- name: Build and run tests
env:
CC: clang
CXX: clang++
run: |
scripts/test.sh
ubuntu-make-gcc:
name: Ubuntu (make, gcc)
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Build and run tests
env:
CC: gcc
CXX: g++
run: |
scripts/initbuild.sh make
scripts/test.sh
macos:
name: macOS
runs-on: macos-12
steps:
- name: Prepare
run: |
brew install cmake ninja
- uses: actions/checkout@v3
- name: Build and run tests
run: |
scripts/test.sh
windows:
name: Windows
runs-on: windows-2022
steps:
- uses: microsoft/[email protected]
- uses: actions/checkout@v3
- name: Build and run tests
run: |
cmake .
msbuild FlatCC.sln /m /property:Configuration=Release
ctest -VV
193 changes: 193 additions & 0 deletions .github/workflows/weekly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
name: Weekly

on:
workflow_dispatch:
schedule:
- cron: '0 10 * * 1' # Mon 10.00 UTC

env:
CTEST_OUTPUT_ON_FAILURE: 1

jobs:
clang:
name: Clang ${{ matrix.clang-version }}
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
clang-version: [5, 7, 9, 11, 13, 15]
steps:
- name: Setup Clang
uses: aminya/setup-cpp@v1
with:
llvm: ${{ matrix.clang-version }}
- uses: actions/checkout@v3
- name: Build and run tests
run: |
scripts/initbuild.sh make-concurrent
scripts/test.sh
clang-32bit:
name: Clang 32bit
runs-on: ubuntu-20.04
steps:
- name: Prepare
run: |
sudo apt update
sudo apt install gcc-multilib g++-multilib
- uses: actions/checkout@v3
- name: Build and run tests
env:
CC: clang
CXX: clang++
run: |
scripts/initbuild.sh make-32bit
scripts/test.sh
gcc-old:
name: GCC 4.4
runs-on: ubuntu-20.04
steps:
- name: Setup GCC
run: |
wget http://launchpadlibrarian.net/336269522/libmpfr4_3.1.6-1_amd64.deb
wget http://old-releases.ubuntu.com/ubuntu/pool/universe/g/gcc-4.4/gcc-4.4-base_4.4.7-8ubuntu1_amd64.deb
wget http://old-releases.ubuntu.com/ubuntu/pool/universe/g/gcc-4.4/cpp-4.4_4.4.7-8ubuntu1_amd64.deb
wget http://old-releases.ubuntu.com/ubuntu/pool/universe/g/gcc-4.4/gcc-4.4_4.4.7-8ubuntu1_amd64.deb
wget http://old-releases.ubuntu.com/ubuntu/pool/universe/g/gcc-4.4/libstdc++6-4.4-dev_4.4.7-8ubuntu1_amd64.deb
wget http://old-releases.ubuntu.com/ubuntu/pool/universe/g/gcc-4.4/g++-4.4_4.4.7-8ubuntu1_amd64.deb
sudo dpkg -i ./libmpfr4_3.1.6-1_amd64.deb
sudo dpkg -i ./gcc-4.4-base_4.4.7-8ubuntu1_amd64.deb
sudo dpkg -i ./cpp-4.4_4.4.7-8ubuntu1_amd64.deb
sudo dpkg -i ./gcc-4.4_4.4.7-8ubuntu1_amd64.deb
sudo dpkg -i ./libstdc++6-4.4-dev_4.4.7-8ubuntu1_amd64.deb ./g++-4.4_4.4.7-8ubuntu1_amd64.deb
- uses: actions/checkout@v3
- name: Build and run tests
env:
CC: gcc-4.4
CXX: g++-4.4
run: |
scripts/initbuild.sh make-concurrent
scripts/test.sh
gcc:
name: GCC ${{ matrix.gcc-version }}
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
gcc-version: [7, 9, 11]
steps:
- name: Setup GCC
uses: aminya/setup-cpp@v1
with:
gcc: ${{ matrix.gcc-version }}
- uses: actions/checkout@v3
- name: Build and run tests
run: |
scripts/initbuild.sh make-concurrent
scripts/test.sh
gcc-32bit:
name: GCC 32bit
runs-on: ubuntu-20.04
steps:
- name: Prepare
run: |
sudo apt update
sudo apt install gcc-multilib g++-multilib
- uses: actions/checkout@v3
- name: Build and run tests
run: |
scripts/initbuild.sh make-32bit
scripts/test.sh
intel:
name: Intel ${{ matrix.compiler }}
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
compiler: [icc, icx]
steps:
- name: Prepare
run: |
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | \
gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | \
sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt update
sudo apt install intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-2021.4.0
- name: Setup Intel oneAPI
run: |
source /opt/intel/oneapi/setvars.sh
printenv >> $GITHUB_ENV
- uses: actions/checkout@v3
- name: Build and run tests
env:
CC: ${{ matrix.compiler }}
CXX: ${{ matrix.compiler }}
run: |
scripts/initbuild.sh make-concurrent
scripts/test.sh
macos-clang:
name: macOS Clang
runs-on: macos-11
steps:
- uses: actions/checkout@v3
- name: Build and run tests
run: |
scripts/initbuild.sh make-concurrent
scripts/test.sh
macos-gcc:
name: macOS GCC ${{ matrix.gcc-version }}
runs-on: macos-11
strategy:
fail-fast: false
matrix:
gcc-version: [9, 12]
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
brew install gcc@${{ matrix.gcc-version }}
- name: Build and run tests
env:
CC: gcc-${{ matrix.gcc-version }}
CXX: g++-${{ matrix.gcc-version }}
run: |
scripts/initbuild.sh make-concurrent
scripts/test.sh
windows:
name: Windows Visual Studio ${{ matrix.version }}
runs-on: windows-${{ matrix.version }}
strategy:
fail-fast: false
matrix:
version: [2019, 2022]
steps:
- uses: microsoft/[email protected]
- uses: actions/checkout@v3
- name: Build and run tests
run: |
cmake .
msbuild FlatCC.sln /m /property:Configuration=Release
ctest -VV
cmake-minimum-required:
name: CMake 2.8.12 (min. required)
runs-on: ubuntu-20.04
steps:
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1
with:
cmake-version: 2.8.12
- uses: actions/checkout@v3
- name: Build and run tests
run: |
cmake --version
scripts/initbuild.sh make-concurrent
scripts/test.sh
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ bin/*
lib/*
release/*
scripts/build.cfg
compile_flags.txt
compile_commands.json
.cache
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,25 @@
## [0.6.2-pre]

- CMake: avoid assuming location of build dir during configuration.

- Use untyped integer constants in place of enums for public interface flags to
allow for safe bit masking operations (PR #248).
- Added experimental support for generating `compile_commands.json` via
`CMakeList.txt` for use with clangd.
- Remove `fallthrough` macro for improved portability (#247, #252).
- Added `parse_float/double_compare`, `parse_float/double_is_equal` to
portable library, and added `parse_float/double_isnan` to mirror isinf.
This should help with GCC 32-bit double precision conversion issue.
- Add Github Actions builds to replace stale Travis CI build. This also
includes source code fixes for some build variants. Although
Windows build is included it only covers recent 64-bit Windows. More
work is need for older Windows variants. (#250).
- Increase maximum allowed schema file size from 64 KiB to 1 MB (#256).
- Fix seg fault in json parser while adding null characters to a too
short input string for a fixed length char array struct field (#257).
- Fix regression where empty namespace in schema does not reset root scope
correctly in parser (#265).
- Fix lexer checks that breaks with UTF-8, notably UTF-8 schema comments (#267).
- Add sanitizer flag for clang debug and related warnings (input from several PRs incl. #237)

## [0.6.1]

Expand Down
20 changes: 17 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# Ubuntu 14.04 (Trusty)
#cmake_minimum_required (VERSION 2.8.12.2)
cmake_minimum_required (VERSION 2.8.12.2)
# Centos 7
#cmake_minimum_required (VERSION 2.8.11)
cmake_minimum_required (VERSION 2.8)
#cmake_minimum_required (VERSION 2.8)

# Experimental for generating compile_commands.json so editors with
# clangd language server support can use it. Symlink
# build/Debug/compile_commands.json to project root where it is
# gitignored.
#set(CMAKE_EXPORT_COMPILE_COMMANDS 1)

# Disable build of tests and samples. Due to custom build step
# dependency on flatcc tool, some custom build configurations may
Expand Down Expand Up @@ -165,7 +171,7 @@ message(STATUS "lib install dir ${dist_dir}/${lib_dir}")
# and constants should be turned off - those are plentiful. They are
# silenced for Clang, GCC and MSVC in generated headers.headers.

if (CMAKE_C_COMPILER_ID MATCHES "Clang")
if (CMAKE_C_COMPILER_ID MATCHES "Clang" AND NOT "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC")
# Clang or AppleClang
message(STATUS "Setting Clang compiler options")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wstrict-prototypes")
Expand All @@ -182,6 +188,14 @@ if (CMAKE_C_COMPILER_ID MATCHES "Clang")
if (FLATCC_IGNORE_CONST_COND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-tautological-constant-out-of-range-compare")
endif()
if (CMAKE_BUILD_TYPE MATCHES Debug)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined")
endif()
# Suppress warning relaxed in clang-6, see https://reviews.llvm.org/D28148
if (CMAKE_C_COMPILER_VERSION VERSION_LESS 6)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-missing-field-initializers")
endif()

# To get assembly output
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -save-temps")
Expand Down
Loading

0 comments on commit ba7fb17

Please sign in to comment.