Skip to content
This repository has been archived by the owner on Feb 25, 2023. It is now read-only.

Commit

Permalink
Squashed 'deps/ccommon/' changes from 5e64de2..0db032a
Browse files Browse the repository at this point in the history
0db032a tuning cmake / ci further (twitter#243)
49dcaff improve cargo build script (twitter#244)

git-subtree-dir: deps/ccommon
git-subtree-split: 0db032afcac0a75887281c3876ed9f7bb10391ce
  • Loading branch information
Yao Yue committed May 23, 2020
1 parent 14b8142 commit ba734e3
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 29 deletions.
29 changes: 8 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,45 +11,32 @@ addons:
# important for allowed-to-fail matching
# see https://docs.travis-ci.com/user/customizing-the-build#Rows-that-are-Allowed-to-Fail
env:
- ALLOWED_TO_FAIL=0
global:
- MAKEFLAGS="-j 2"

# travis currently does not support directly setting gcc/clang with versions
# (e.g. gcc-4.8) as value for the compiler key. So we will have to manually
# request these packages and use environment varibles to create the matrix.
matrix:
jobs:
fast_finish: true
include:
- name: "gcc-7 on Linux"
compiler: gcc
addons:
apt:
<<: *apt
packages:
- libsubunit-dev

- name: "gcc-7 on Linux, Rust enabled"
compiler: gcc
env:
- RUST_ENABLED=1
addons:
apt:
<<: *apt
packages:
- libsubunit-dev

- os: osx
osx_image: xcode11.4
compiler: clang

- name: "cargo build"
language: rust
addons:
apt:
<<: *apt
packages:
- libsubunit-dev
script:
- ./ci/cargo.sh

- os: osx
osx_image: xcode11.4
compiler: clang

- os: osx
osx_image: xcode11.4
language: rust
Expand Down
17 changes: 14 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,9 @@ if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,--no-as-needed -ldl -pthread -fPIC")
endif()

include(FindPackageHandleStandardArgs)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")


include(FindPackageHandleStandardArgs)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
# test dependencies
if (HAVE_TEST)
enable_testing()
Expand Down Expand Up @@ -220,6 +219,9 @@ endif()
# print a summary #
###################

message(STATUS "<<++=====------------------\\/------------------=====++>>")
message(STATUS "<<++ ccommon summary ++>>")
message(STATUS "<<++=====------------------/\\------------------=====++>>")
message(STATUS "=============CMake related=============")
message(STATUS "CMAKE_BUILD_TYPE: " ${CMAKE_BUILD_TYPE})
message(STATUS "PLATFORM: " ${OS_PLATFORM})
Expand Down Expand Up @@ -248,3 +250,12 @@ message(STATUS "HAVE_TEST: " ${HAVE_TEST})
message(STATUS "HAVE_COVERAGE: " ${HAVE_COVERAGE})
message(STATUS "=======================================")


if(DUMP_ALL)
message(STATUS "<<++=====------------------\\/------------------=====++>>")
get_cmake_property(_variableNames VARIABLES)
foreach (_variableName ${_variableNames})
message(STATUS "${_variableName}=${${_variableName}}")
endforeach()
message(STATUS "<<++=====------------------/\\------------------=====++>>")
endif()
3 changes: 2 additions & 1 deletion ci/cargo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ cat > Cargo.toml <<HEADER
members = [
HEADER

for CRATE_ROOT in `find rust -type d -mindepth 1 -maxdepth 1`; do
for CRATE_MANIFEST in `find rust -type f -name "Cargo.toml"`; do
CRATE_ROOT=`dirname ${CRATE_MANIFEST}`
echo "\"${CRATE_ROOT}\"," >> Cargo.toml
done

Expand Down
8 changes: 4 additions & 4 deletions ci/install-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ realpath() { python3 -c "import os,sys; print(os.path.realpath(sys.argv[1]))" "$
TOPLEVEL="$(cd "$(dirname "$(realpath "$0" >/dev/null || exit 1)")" && git rev-parse --show-toplevel)" || die 'failed to find TOPLEVEL'


CHECK_VERSION="0.14-tf"
CHECK_TARBALL="${CHECK_VERSION}.tar.gz"
CHECK_VERSION="0.14.0"
CHECK_TARBALL="check-${CHECK_VERSION}.tar.gz"
CHECK_DIR="check-${CHECK_VERSION}"
CHECK_LOG="build-check.log"

echo "building and installing check" >&2

(
cd "$TEMP" &&
wget "https://github.com/thinkingfish/check/archive/${CHECK_TARBALL}" &&
wget "https://github.com/libcheck/check/releases/download/${CHECK_VERSION}/${CHECK_TARBALL}" &&
tar xfz "${CHECK_TARBALL}" &&
cd "${CHECK_DIR}" &&
mkdir build &&
cd build &&
cmake -DCMAKE_INSTALL_PREFIX="${CHECK_PREFIX}" -DDISABLE_SUBUNIT=ON .. &&
cmake -DCMAKE_INSTALL_PREFIX="${CHECK_PREFIX}" .. &&
make -j &&
make install
) >$TEMP/${CHECK_LOG} 2>&1
Expand Down

0 comments on commit ba734e3

Please sign in to comment.