Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
54 changes: 54 additions & 0 deletions .github/workflows/generic-arm-gcc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: build default on generic arm gcc

on:
repository_dispatch:
workflow_dispatch:
push:
pull_request:
schedule:
- cron: '0 */2 * * *'

env:
BUILD_TYPE: Release

jobs:
build:
name: Test on ${{matrix.os}}
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-22.04]

steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: install dependencies
run: |
sudo apt update
sudo apt install cmake make \
gcc gcc-arm-none-eabi

- name: configure cmake
run: |
cmake -B ${{github.workspace}}/build \
-D CMAKE_INSTALL_PREFIX=${{github.workspace}}/build/install \
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-D CMAKE_C_COMPILER=arm-none-eabi-gcc \
-D CMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY \
-D CMAKE_SYSTEM_NAME=Generic \
-D HOST_C_COMPILER=gcc \
-D BFDEV_STRICT=ON \
-D BFDEV_BUILD_SHARED=OFF

- name: make
run: |
cmake --build ${{github.workspace}}/build \
--config ${{env.BUILD_TYPE}}

- name: install
run: |
cmake --build ${{github.workspace}}/build \
--config ${{env.BUILD_TYPE}} -- install
90 changes: 52 additions & 38 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ option(BFDEV_DEVEL "Enable development mode" OFF)
option(BFDEV_STRICT "Enable strict compilation" OFF)
option(BFDEV_EXAMPLES "Build examples" OFF)
option(BFDEV_TESTSUITE "Build testsuite" OFF)
option(BFDEV_DOCS "Install Documentation" OFF)

option(BFDEV_BUILD_STATIC "Build Static Library" ON)
option(BFDEV_BUILD_SHARED "Build Shared Library" ON)
option(BFDEV_INSTALL_HEADERS "Install Headers" ON)
option(BFDEV_INSTALL_DOCS "Install Documentation" OFF)

option(BFDEV_ASAN "Enable Address Sanitizer" OFF)
option(BFDEV_UBSAN "Enable Undefined Behaviour Sanitizer" OFF)
Expand All @@ -75,7 +79,7 @@ if(BFDEV_DEVEL)
set(BFDEV_STRICT ON)
set(BFDEV_EXAMPLES ON)
set(BFDEV_TESTSUITE ON)
set(BFDEV_DOCS ON)
set(BFDEV_INSTALL_DOCS ON)
set(BFDEV_ASAN ON)
set(BFDEV_UBSAN ON)
set(BFDEV_GCOV ON)
Expand Down Expand Up @@ -158,43 +162,59 @@ if(BFDEV_TESTSUITE)
endif()

if(${CMAKE_PROJECT_NAME} STREQUAL "bfdev")
add_library(bfdev_static STATIC ${BFDEV_LIBRARY})
add_library(bfdev_shared SHARED ${BFDEV_LIBRARY})
if(BFDEV_BUILD_STATIC)
add_library(bfdev_static STATIC ${BFDEV_LIBRARY})
bfdev_dependencies(bfdev_static)

set_target_properties(bfdev_static
PROPERTIES
OUTPUT_NAME ${PROJECT_NAME}
LINKER_LANGUAGE C
)

bfdev_dependencies(bfdev_static)
bfdev_dependencies(bfdev_shared)
install(TARGETS
bfdev_static
DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()

set_target_properties(bfdev_static
PROPERTIES
OUTPUT_NAME ${PROJECT_NAME}
LINKER_LANGUAGE C
)
if(BFDEV_BUILD_SHARED)
add_library(bfdev_shared SHARED ${BFDEV_LIBRARY})
bfdev_dependencies(bfdev_shared)

set_target_properties(bfdev_shared
PROPERTIES
OUTPUT_NAME ${PROJECT_NAME}
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
LINKER_LANGUAGE C
MACOSX_RPATH ON
)

set_target_properties(bfdev_shared
PROPERTIES
OUTPUT_NAME ${PROJECT_NAME}
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
LINKER_LANGUAGE C
MACOSX_RPATH ON
)
install(TARGETS
bfdev_shared
DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()

install(FILES
${BFDEV_CONFIGURE}
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/bfdev
)
if(BFDEV_INSTALL_HEADERS)
install(FILES
${BFDEV_CONFIGURE}
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/bfdev
)

install(FILES
${BFDEV_EXPORT_PATH}/bfdev.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(FILES
${BFDEV_EXPORT_PATH}/bfdev.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

install(DIRECTORY
${BFDEV_EXPORT_PATH}/bfdev
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(DIRECTORY
${BFDEV_EXPORT_PATH}/bfdev
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
endif()

if(BFDEV_DOCS)
if(BFDEV_INSTALL_DOCS)
install(FILES
${PROJECT_SOURCE_DIR}/README.md
${PROJECT_SOURCE_DIR}/AUTHORS
Expand All @@ -208,10 +228,4 @@ if(${CMAKE_PROJECT_NAME} STREQUAL "bfdev")
DESTINATION ${CMAKE_INSTALL_DOCDIR}
)
endif()

install(TARGETS
bfdev_static bfdev_shared
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ bfdev is a high-performance, aesthetically pleasing, and portable infrastructure
| [![build status](https://github.com/openbfdev/bfdev/actions/workflows/ubuntu-aarch64-gcc.yml/badge.svg?branch=master)](https://github.com/openbfdev/bfdev/actions/workflows/ubuntu-aarch64-gcc.yml?query=branch%3Amaster) | [![build status](https://github.com/openbfdev/bfdev/actions/workflows/ubuntu-aarch64-gcc.yml/badge.svg?branch=devel)](https://github.com/openbfdev/bfdev/actions/workflows/ubuntu-aarch64-gcc.yml?query=branch%3Adevel) | Cross build AArch64 default on Ubuntu GCC |
| [![build status](https://github.com/openbfdev/bfdev/actions/workflows/ubuntu-mips-gcc.yml/badge.svg?branch=master)](https://github.com/openbfdev/bfdev/actions/workflows/ubuntu-mips-gcc.yml?query=branch%3Amaster) | [![build status](https://github.com/openbfdev/bfdev/actions/workflows/ubuntu-mips-gcc.yml/badge.svg?branch=devel)](https://github.com/openbfdev/bfdev/actions/workflows/ubuntu-mips-gcc.yml?query=branch%3Adevel) | Cross build MIPS default on Ubuntu GCC |
| [![build status](https://github.com/openbfdev/bfdev/actions/workflows/ubuntu-mips64-gcc.yml/badge.svg?branch=master)](https://github.com/openbfdev/bfdev/actions/workflows/ubuntu-mips64-gcc.yml?query=branch%3Amaster) | [![build status](https://github.com/openbfdev/bfdev/actions/workflows/ubuntu-mips64-gcc.yml/badge.svg?branch=devel)](https://github.com/openbfdev/bfdev/actions/workflows/ubuntu-mips64-gcc.yml?query=branch%3Adevel) | Cross build MIPS64 default on Ubuntu GCC |
| [![build status](https://github.com/openbfdev/bfdev/actions/workflows/generic-arm-gcc.yml/badge.svg?branch=master)](https://github.com/openbfdev/bfdev/actions/workflows/generic-arm-gcc.yml?query=branch%3Amaster) | [![build status](https://github.com/openbfdev/bfdev/actions/workflows/generic-arm-gcc.yml/badge.svg?branch=devel)](https://github.com/openbfdev/bfdev/actions/workflows/generic-arm-gcc.yml?query=branch%3Adevel) | Cross build ARM default on Generic GCC |
| [![build status](https://github.com/openbfdev/bfdev/actions/workflows/codeql.yml/badge.svg?branch=master)](https://github.com/openbfdev/bfdev/actions/workflows/codeql.yml?query=branch%3Amaster) | [![build status](https://github.com/openbfdev/bfdev/actions/workflows/codeql.yml/badge.svg?branch=devel)](https://github.com/openbfdev/bfdev/actions/workflows/codeql.yml?query=branch%3Adevel) | Code analyse on codeql |

## Why Choose
Expand Down
1 change: 1 addition & 0 deletions port/posix/build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ check_symbol_and_exit("stdlib.h" "abort")

# string
check_symbol_and_exit("string.h" "memcpy")
check_symbol_and_exit("string.h" "memmove")
check_symbol_and_exit("string.h" "memset")
check_symbol_and_exit("string.h" "memcmp")
check_symbol_and_exit("string.h" "strcmp")
Expand Down
Loading