Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON support #12

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
_cxx="${_cc/#gcc/g++}"
_dir="build/dbg_$_cc"
mkdir -p "$_dir"
make -j$ncpu -C src O="../$_dir" debug=1 CC="$_cc" CXX="$_cxx"
make V=1 -j$ncpu -C src O="../$_dir" debug=1 CC="$_cc" CXX="$_cxx"
(( $? == 0 )) || touch "$_dir/failed"
done

Expand All @@ -90,7 +90,7 @@ jobs:
_cxx="${_cc/#clang/clang++}"
_dir="build/dbg_$_cc"
mkdir -p "$_dir"
make -j$ncpu -C src O="../$_dir" debug=1 CC="$_cc" CXX="$_cxx"
make V=1 -j$ncpu -C src O="../$_dir" debug=1 CC="$_cc" CXX="$_cxx"
ret=$?
if (( ret == 139 )); then
fmt='\n\e[1m\e[33mIgnoring SIGSEGV during %s build.\e[m\n\n'
Expand All @@ -115,7 +115,7 @@ jobs:
_cxx="${_cc/#gcc/g++}"
_dir="build/rel_$_cc"
mkdir -p "$_dir"
make -j$ncpu -C src O="../$_dir" CC="$_cc" CXX="$_cxx"
make V=1 -j$ncpu -C src O="../$_dir" CC="$_cc" CXX="$_cxx"
(( $? == 0 )) || touch "$_dir/failed"
done

Expand All @@ -129,7 +129,7 @@ jobs:
_cxx="${_cc/#clang/clang++}"
_dir="build/rel_$_cc"
mkdir -p "$_dir"
make -j$ncpu -C src O="../$_dir" CC="$_cc" CXX="$_cxx"
make V=1 -j$ncpu -C src O="../$_dir" CC="$_cc" CXX="$_cxx"
ret=$?
if (( ret == 139 )); then
fmt='\n\e[1m\e[33mIgnoring SIGSEGV during %s build.\e[m\n\n'
Expand Down Expand Up @@ -253,7 +253,7 @@ jobs:
_cxx="${_cc/#gcc/g++}"
_dir="build/dbg_$_cc"
mkdir -p "$_dir"
make -j$ncpu -C src O="../$_dir" debug=1 CC="$_cc" CXX="$_cxx"
make V=1 -j$ncpu -C src O="../$_dir" debug=1 CC="$_cc" CXX="$_cxx"
(( $? == 0 )) || touch "$_dir/failed"
done

Expand All @@ -267,7 +267,7 @@ jobs:
_cxx="${_cc/#clang/clang++}"
_dir="build/dbg_$_cc"
mkdir -p "$_dir"
make -j$ncpu -C src O="../$_dir" debug=1 CC="$_cc" CXX="$_cxx"
make V=1 -j$ncpu -C src O="../$_dir" debug=1 CC="$_cc" CXX="$_cxx"
ret=$?
if (( ret == 139 )); then
fmt='\n\e[1m\e[33mIgnoring SIGSEGV during %s build.\e[m\n\n'
Expand All @@ -292,7 +292,7 @@ jobs:
_cxx="${_cc/#gcc/g++}"
_dir="build/rel_$_cc"
mkdir -p "$_dir"
make -j$ncpu -C src O="../$_dir" CC="$_cc" CXX="$_cxx"
make V=1 -j$ncpu -C src O="../$_dir" CC="$_cc" CXX="$_cxx"
(( $? == 0 )) || touch "$_dir/failed"
done

Expand All @@ -306,7 +306,7 @@ jobs:
_cxx="${_cc/#clang/clang++}"
_dir="build/rel_$_cc"
mkdir -p "$_dir"
make -j$ncpu -C src O="../$_dir" CC="$_cc" CXX="$_cxx"
make V=1 -j$ncpu -C src O="../$_dir" CC="$_cc" CXX="$_cxx"
ret=$?
if (( ret == 139 )); then
fmt='\n\e[1m\e[33mIgnoring SIGSEGV during %s build.\e[m\n\n'
Expand Down Expand Up @@ -430,7 +430,7 @@ jobs:
_cxx="${_cc/#gcc/g++}"
_dir="build/dbg_$_cc"
mkdir -p "$_dir"
make -j$ncpu -C src O="../$_dir" debug=1 CC="$_cc" CXX="$_cxx"
make V=1 -j$ncpu -C src O="../$_dir" debug=1 CC="$_cc" CXX="$_cxx"
(( $? == 0 )) || touch "$_dir/failed"
done

Expand All @@ -444,7 +444,7 @@ jobs:
_cxx="${_cc/#clang/clang++}"
_dir="build/dbg_$_cc"
mkdir -p "$_dir"
make -j$ncpu -C src O="../$_dir" debug=1 CC="$_cc" CXX="$_cxx"
make V=1 -j$ncpu -C src O="../$_dir" debug=1 CC="$_cc" CXX="$_cxx"
(( $? == 0 )) || touch "$_dir/failed"
done

Expand All @@ -458,7 +458,7 @@ jobs:
_cxx="${_cc/#gcc/g++}"
_dir="build/rel_$_cc"
mkdir -p "$_dir"
make -j$ncpu -C src O="../$_dir" CC="$_cc" CXX="$_cxx"
make V=1 -j$ncpu -C src O="../$_dir" CC="$_cc" CXX="$_cxx"
(( $? == 0 )) || touch "$_dir/failed"
done

Expand All @@ -472,7 +472,7 @@ jobs:
_cxx="${_cc/#clang/clang++}"
_dir="build/rel_$_cc"
mkdir -p "$_dir"
make -j$ncpu -C src O="../$_dir" CC="$_cc" CXX="$_cxx"
make V=1 -j$ncpu -C src O="../$_dir" CC="$_cc" CXX="$_cxx"
(( $? == 0 )) || touch "$_dir/failed"
done

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@
/.qtc_clangd
/.vscode
/build
/src/stochar
/src/test
/src/test-json
/src/test-utf8
8 changes: 7 additions & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
override THIS_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))

override TARGETS := test test-utf8
override TARGETS := stochar test test-json test-utf8

all:| $(TARGETS)
clean:| $(TARGETS:%=clean-%)
Expand All @@ -18,11 +18,17 @@ ifneq (,$(filter $(PUBLISH),$(or $(MAKECMDGOALS),all)))

include $(THIS_DIR)../common.mk

override SRC_stochar := letopt.c stochar.c utf8.c
override DBG_stochar := dbg.c

override SRC_test := cc.c cxx.cpp dstr.c file.c test.c
override DBG_test := dbg.c
override LIBS_test = $(CJSON_LIBS)
override CFLAGS_test.c = $(CJSON_CFLAGS)

override SRC_test-json := json.c test-json.c
override DBG_test-json := dbg.c

override SRC_test-utf8 := letopt.c test-utf8.c utf8.c
override DBG_test-utf8 := dbg.c

Expand Down
Loading