mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-15 02:18:39 +08:00
C shim library build clean up (#7560)
* Remove unnecessary Implib.so files * Improve cmake dependencies on doctest
This commit is contained in:
parent
347339426b
commit
0a2e5c830c
@ -112,8 +112,8 @@ if(NOT WIN32)
|
||||
test/unit/fdb_api.cpp
|
||||
test/unit/fdb_api.hpp)
|
||||
|
||||
add_library(fdb_cpp INTERFACE)
|
||||
target_sources(fdb_cpp INTERFACE test/fdb_api.hpp)
|
||||
add_library(fdb_cpp INTERFACE test/fdb_api.hpp)
|
||||
target_sources(fdb_cpp INTERFACE )
|
||||
target_include_directories(fdb_cpp INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/test)
|
||||
target_link_libraries(fdb_cpp INTERFACE fmt::fmt)
|
||||
|
||||
@ -187,19 +187,13 @@ if(NOT WIN32)
|
||||
endif()
|
||||
target_link_libraries(fdb_c_api_tester_impl PRIVATE SimpleOpt)
|
||||
|
||||
add_dependencies(fdb_c_setup_tests doctest)
|
||||
add_dependencies(fdb_c_unit_tests_impl doctest)
|
||||
add_dependencies(fdb_c_unit_tests_version_510 doctest)
|
||||
add_dependencies(disconnected_timeout_unit_tests doctest)
|
||||
target_include_directories(fdb_c_setup_tests PUBLIC ${DOCTEST_INCLUDE_DIR})
|
||||
target_include_directories(fdb_c_unit_tests_impl PUBLIC ${DOCTEST_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/foundationdb/)
|
||||
target_include_directories(fdb_c_unit_tests_version_510 PUBLIC ${DOCTEST_INCLUDE_DIR} ${CMAKE_BINARY_DIR}/flow/include)
|
||||
target_include_directories(disconnected_timeout_unit_tests PUBLIC ${DOCTEST_INCLUDE_DIR})
|
||||
target_link_libraries(fdb_c_setup_tests PRIVATE fdb_c Threads::Threads)
|
||||
target_link_libraries(fdb_c_unit_tests_impl PRIVATE fdb_c Threads::Threads fdbclient rapidjson)
|
||||
target_link_libraries(fdb_c_unit_tests_version_510 PRIVATE fdb_c Threads::Threads)
|
||||
target_link_libraries(trace_partial_file_suffix_test PRIVATE fdb_c Threads::Threads flow)
|
||||
target_link_libraries(disconnected_timeout_unit_tests PRIVATE fdb_c Threads::Threads)
|
||||
target_include_directories(fdb_c_unit_tests_impl PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/foundationdb/)
|
||||
target_include_directories(fdb_c_unit_tests_version_510 PUBLIC ${CMAKE_BINARY_DIR}/flow/include)
|
||||
target_link_libraries(fdb_c_setup_tests PRIVATE fdb_c Threads::Threads doctest)
|
||||
target_link_libraries(fdb_c_unit_tests_impl PRIVATE fdb_c Threads::Threads fdbclient rapidjson doctest)
|
||||
target_link_libraries(fdb_c_unit_tests_version_510 PRIVATE fdb_c Threads::Threads doctest)
|
||||
target_link_libraries(trace_partial_file_suffix_test PRIVATE fdb_c Threads::Threads flow doctest)
|
||||
target_link_libraries(disconnected_timeout_unit_tests PRIVATE fdb_c Threads::Threads doctest)
|
||||
|
||||
# do not set RPATH for mako
|
||||
set_property(TARGET mako PROPERTY SKIP_BUILD_RPATH TRUE)
|
||||
@ -426,7 +420,12 @@ if (NOT WIN32 AND NOT APPLE AND NOT OPEN_FOR_IDE)
|
||||
endif()
|
||||
|
||||
# Generate shim library in Linux builds
|
||||
if (NOT WIN32 AND NOT APPLE AND NOT OPEN_FOR_IDE)
|
||||
if (OPEN_FOR_IDE)
|
||||
|
||||
add_library(fdb_c_shim OBJECT fdb_c_shim.cpp)
|
||||
target_link_libraries(fdb_c_shim PUBLIC dl)
|
||||
|
||||
elseif(NOT WIN32 AND NOT APPLE AND NOT OPEN_FOR_IDE) # Linux Only
|
||||
|
||||
set(SHIM_LIB_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
|
@ -3,7 +3,7 @@ include(ExternalProject)
|
||||
find_package(Git REQUIRED)
|
||||
|
||||
ExternalProject_Add(
|
||||
doctest
|
||||
doctest_proj
|
||||
PREFIX ${CMAKE_BINARY_DIR}/doctest
|
||||
GIT_REPOSITORY https://github.com/onqtam/doctest.git
|
||||
GIT_TAG 7b9885133108ae301ddd16e2651320f54cafeba7 # v2.4.8
|
||||
@ -14,5 +14,8 @@ ExternalProject_Add(
|
||||
LOG_DOWNLOAD ON
|
||||
)
|
||||
|
||||
ExternalProject_Get_Property(doctest source_dir)
|
||||
set(DOCTEST_INCLUDE_DIR ${source_dir}/doctest CACHE INTERNAL "Path to include folder for doctest")
|
||||
ExternalProject_Get_Property(doctest_proj source_dir)
|
||||
set(DOCTEST_INCLUDE_DIR "${source_dir}/doctest" CACHE INTERNAL "Path to include folder for doctest")
|
||||
add_library(doctest INTERFACE)
|
||||
add_dependencies(doctest doctest_proj)
|
||||
target_include_directories(doctest INTERFACE "${DOCTEST_INCLUDE_DIR}")
|
||||
|
144
contrib/Implib.so/.github/workflows/ci.yml
vendored
144
contrib/Implib.so/.github/workflows/ci.yml
vendored
@ -1,144 +0,0 @@
|
||||
# TODO:
|
||||
# * Android
|
||||
# * FreeBSD
|
||||
|
||||
name: CI
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- 'LICENSE.txt'
|
||||
- 'README.md'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- 'LICENSE.txt'
|
||||
- 'README.md'
|
||||
jobs:
|
||||
Baseline:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-18.04, ubuntu-20.04, ubuntu-latest]
|
||||
cc: [[gcc, g++], [clang, clang++]]
|
||||
py: [python3.6, python3.7, python3] # We need f-strings so 3.6+
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
CC: ${{ matrix.cc[0] }}
|
||||
CXX: ${{ matrix.cc[1] }}
|
||||
PYTHON: ${{ matrix.py }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install deps
|
||||
run: |
|
||||
sudo add-apt-repository ppa:deadsnakes/ppa
|
||||
sudo apt-get update
|
||||
sudo apt-get install ${PYTHON}
|
||||
sudo apt-get install ${PYTHON}-pip || true
|
||||
- name: Run tests
|
||||
run: scripts/travis.sh
|
||||
PyPy: # Can't test this in matrix, pypy package has different names in old distros
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
PYTHON: pypy3
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install deps
|
||||
run: sudo apt-get install ${PYTHON}
|
||||
- name: Run tests
|
||||
run: scripts/travis.sh
|
||||
Pylint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install deps
|
||||
run: sudo apt-get install pylint
|
||||
- name: Run tests
|
||||
run: |
|
||||
pylint implib-gen.py
|
||||
pylint scripts/ld
|
||||
Coverage:
|
||||
runs-on: ubuntu-latest
|
||||
environment: secrets
|
||||
env:
|
||||
COVERAGE: 1
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
PYTHON: 'coverage run -a'
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install deps
|
||||
run: |
|
||||
sudo apt-get install python3 python3-pip
|
||||
sudo python3 -mpip install codecov
|
||||
- name: Run tests
|
||||
run: scripts/travis.sh
|
||||
- name: Upload coverage
|
||||
run: |
|
||||
for t in tests/*; do
|
||||
if test -d $t; then
|
||||
(cd $t && coverage xml)
|
||||
fi
|
||||
done
|
||||
codecov --required
|
||||
x86:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
ARCH: i386-linux-gnueabi
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install deps
|
||||
run: sudo apt-get install gcc-multilib g++-multilib
|
||||
- name: Run tests
|
||||
run: scripts/travis.sh
|
||||
arm-arm:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
ARCH: arm-linux-gnueabi
|
||||
CFLAGS: -marm
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install deps
|
||||
run: sudo apt-get install qemu-user gcc-arm-linux-gnueabi g++-arm-linux-gnueabi binutils-arm-linux-gnueabi libc6-armel-cross libc6-dev-armel-cross
|
||||
- name: Run tests
|
||||
run: scripts/travis.sh
|
||||
arm-thumb:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
ARCH: arm-linux-gnueabi
|
||||
CFLAGS: -mthumb
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install deps
|
||||
run: sudo apt-get install qemu-user gcc-arm-linux-gnueabi g++-arm-linux-gnueabi binutils-arm-linux-gnueabi libc6-armel-cross libc6-dev-armel-cross
|
||||
- name: Run tests
|
||||
run: scripts/travis.sh
|
||||
armhf-arm:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
ARCH: arm-linux-gnueabihf
|
||||
CFLAGS: -marm
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install deps
|
||||
run: sudo apt-get install qemu-user gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf binutils-arm-linux-gnueabihf libc6-armhf-cross libc6-dev-armhf-cross
|
||||
- name: Run tests
|
||||
run: scripts/travis.sh
|
||||
armhf-thumb:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
ARCH: arm-linux-gnueabihf
|
||||
CFLAGS: -mthumb
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install deps
|
||||
run: sudo apt-get install qemu-user gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf binutils-arm-linux-gnueabihf libc6-armhf-cross libc6-dev-armhf-cross
|
||||
- name: Run tests
|
||||
run: scripts/travis.sh
|
||||
aarch64:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
ARCH: aarch64-linux-gnueabi
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install deps
|
||||
run: sudo apt-get install qemu-user gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu libc6-arm64-cross libc6-dev-arm64-cross
|
||||
- name: Run tests
|
||||
run: scripts/travis.sh
|
Loading…
x
Reference in New Issue
Block a user