Skip to content

Commit 0b25e50

Browse files
authored
Merge pull request #665 from sanpeqf/feat-port
feat port: removed any dependencies on the system
2 parents 73f1777 + 72eddef commit 0b25e50

234 files changed

Lines changed: 2895 additions & 2265 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: build generic on ubuntu gcc
2+
3+
on:
4+
repository_dispatch:
5+
workflow_dispatch:
6+
push:
7+
pull_request:
8+
schedule:
9+
- cron: '0 */2 * * *'
10+
11+
env:
12+
BUILD_TYPE: Release
13+
14+
jobs:
15+
build:
16+
name: Test on ${{matrix.os}}
17+
runs-on: ${{matrix.os}}
18+
strategy:
19+
matrix:
20+
os: [ubuntu-22.04]
21+
22+
steps:
23+
- name: checkout
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- name: install dependencies
29+
run: |
30+
sudo apt update
31+
sudo apt install cmake make gcc ccache
32+
33+
- name: configure cmake
34+
run: |
35+
cmake -B ${{github.workspace}}/build \
36+
-D CMAKE_INSTALL_PREFIX=${{github.workspace}}/build/install \
37+
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
38+
-D CMAKE_C_COMPILER=/usr/lib/ccache/gcc \
39+
-D CMAKE_SYSTEM_NAME=Generic -Wno-dev \
40+
-D BFDEV_DEVEL=ON
41+
42+
- name: make
43+
run: |
44+
cmake --build ${{github.workspace}}/build \
45+
--config ${{env.BUILD_TYPE}}
46+
47+
- name: install
48+
run: |
49+
cmake --build ${{github.workspace}}/build \
50+
--config ${{env.BUILD_TYPE}} -- install

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ cmake_minimum_required(VERSION 3.12)
88
project(bfdev VERSION 1.0.6 LANGUAGES C)
99

1010
include(GNUInstallDirs)
11-
include(CheckIncludeFiles)
11+
include(CheckIncludeFile)
12+
include(CheckSymbolExists)
13+
include(CheckTypeSize)
1214

1315
set(BFDEV_NAME sirius)
1416
set(BFDEV_VERSION ${PROJECT_VERSION})
@@ -23,6 +25,7 @@ set(BFDEV_ARCH generic)
2325
set(BFDEV_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
2426
set(BFDEV_HEADER_PATH ${PROJECT_SOURCE_DIR}/include)
2527
set(BFDEV_SOURCE_PATH ${PROJECT_SOURCE_DIR}/src)
28+
set(BFDEV_PORT_PATH ${PROJECT_SOURCE_DIR}/port)
2629
set(BFDEV_DOCUMENT_PATH ${PROJECT_SOURCE_DIR}/docs)
2730
set(BFDEV_GENERATED_PATH ${PROJECT_BINARY_DIR}/generated)
2831
set(BFDEV_EXPORT_PATH ${PROJECT_BINARY_DIR}/export)

build.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ if(BFDEV_STRICT)
2424
)
2525
endif()
2626

27+
include(scripts/check.cmake)
2728
include(scripts/sanitize.cmake)
2829
include(scripts/asm-generic.cmake)
2930

@@ -65,6 +66,7 @@ set(BFDEV_INCLUDE_DIRS
6566
include_directories(${BFDEV_INCLUDE_DIRS})
6667
include(${BFDEV_ARCH_PATH}/build.cmake)
6768
include(${BFDEV_SOURCE_PATH}/build.cmake)
69+
include(${BFDEV_PORT_PATH}/build.cmake)
6870

6971
set(BFDEV_LIBRARY_HEADER
7072
${BFDEV_HEADER}

examples/ascii85/utils.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include <stdio.h>
1010
#include <stdlib.h>
11+
#include <stdbool.h>
1112
#include <string.h>
1213
#include <bfdev/log.h>
1314
#include <bfdev/errname.h>

examples/base32/utils.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include <stdio.h>
1010
#include <stdlib.h>
11+
#include <stdbool.h>
1112
#include <string.h>
1213
#include <bfdev/log.h>
1314
#include <bfdev/errname.h>

examples/base64/utils.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include <stdio.h>
1010
#include <stdlib.h>
11+
#include <stdbool.h>
1112
#include <string.h>
1213
#include <bfdev/log.h>
1314
#include <bfdev/errname.h>

examples/bloom/simple.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include <stdio.h>
77
#include <stdlib.h>
8+
#include <stdbool.h>
89
#include <stdint.h>
910
#include <errno.h>
1011
#include <err.h>

examples/btree/selftest.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66
#include <stdio.h>
7+
#include <stdint.h>
78
#include <stdlib.h>
89
#include <time.h>
910
#include <string.h>

examples/cache/simple.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include <stdio.h>
1010
#include <stdlib.h>
11+
#include <stdint.h>
1112
#include <time.h>
1213
#include <err.h>
1314
#include <bfdev/cache.h>

examples/crypto/utils.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include <stdio.h>
1010
#include <string.h>
11+
#include <stdint.h>
1112
#include <bfdev/log.h>
1213
#include <bfdev/errname.h>
1314
#include <bfdev/sha1.h>

0 commit comments

Comments
 (0)