Skip to content

Commit

Permalink
Use Dragonbox as replacement for missing fp std::to_chars, prevents…
Browse files Browse the repository at this point in the history
… precision issues (#12)

* add macos tests

* use dragonbox as a replacement for missing std::to_chars

* increase version
  • Loading branch information
matcool authored Apr 11, 2024
1 parent 691dcbf commit 28f157b
Show file tree
Hide file tree
Showing 6 changed files with 1,610 additions and 11 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,29 @@ name: Build and test

on:
push:
branches: [ "main" ]
branches: "**"
pull_request:
branches: [ "main" ]
branches: "**"

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- name: Ubuntu
os: ubuntu-latest

- name: macOS
os: macos-latest

runs-on: ${{ matrix.config.os }}

steps:
- uses: actions/checkout@v3

- run: sudo apt install ninja-build
# - run: sudo apt install ninja-build
- uses: seanmiddleditch/gha-setup-ninja@v4

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -G Ninja
Expand Down
11 changes: 8 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
cmake_minimum_required(VERSION 3.21)

project(mat-json VERSION 2.0.0)
project(mat-json VERSION 2.1.0)

set(SOURCE_FILES
src/json.cpp
src/external/dragonbox.cpp
)

# This option is only useful for Geode itself
if (DEFINED MAT_JSON_AS_INTERFACE AND MAT_JSON_AS_INTERFACE)
Expand All @@ -9,9 +14,9 @@ if (DEFINED MAT_JSON_AS_INTERFACE AND MAT_JSON_AS_INTERFACE)

add_library(mat-json-impl INTERFACE)
target_link_libraries(mat-json-impl INTERFACE mat-json)
target_sources(mat-json-impl INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/src/json.cpp)
target_sources(mat-json-impl INTERFACE ${SOURCE_FILES})
else()
add_library(mat-json src/json.cpp)
add_library(mat-json ${SOURCE_FILES})

target_compile_features(mat-json PUBLIC cxx_std_20)

Expand Down
Loading

0 comments on commit 28f157b

Please sign in to comment.