Skip to content

Commit

Permalink
try putting check build under a flag
Browse files Browse the repository at this point in the history
  • Loading branch information
slyphon committed Jul 2, 2018
1 parent ba18119 commit 6851ff1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
37 changes: 20 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ option(TARGET_CDB "build cdb binary" ON)
option(TARGET_RESPCLI "build resp-cli binary" ON)

option(RUST_USE_MUSL "build rust deps against musl" OFF)
option(BUILD_AND_INSTALL_CHECK "build our own version of check and link against it" OFF)

option(COVERAGE "code coverage" OFF)

Expand Down Expand Up @@ -82,26 +83,28 @@ set(CFLAGS_LIST
"-Wunused-function -Wunused-value -Wunused-variable "
"-fno-strict-aliasing ")

# (simms) What follows is a crime against build systems as we run the build/install
# for the check library up front, during the planning phase.

set(LIBCHECK_PREFIX "${CMAKE_BINARY_DIR}/check")
if(BUILD_AND_INSTALL_CHECK)
# (simms) What follows is a crime against build systems as we run the build/install
# for the check library up front, during the planning phase.

set(LIBCHECK_PREFIX "${CMAKE_BINARY_DIR}/check")

# check for a local install of check
if(NOT EXISTS "${LIBCHECK_PREFIX}")
# (simms) This is terrible and I did it this way to ensure this gets built
# before the rest of the 'check' tests run. This should be rewritten so that
# the other dependencies know that there's a target that can build check
execute_process(
COMMAND "bash" "${PROJECT_SOURCE_DIR}/ci/install-check.sh" "${LIBCHECK_PREFIX}"
TIMEOUT 300 # if this doesn't build in 5 minutes something is hosed
)
endif()

# check for a local install of check
if(NOT EXISTS "${LIBCHECK_PREFIX}")
# (simms) This is terrible and I did it this way to ensure this gets built
# before the rest of the 'check' tests run. This should be rewritten so that
# the other dependencies know that there's a target that can build check
execute_process(
COMMAND "bash" "${PROJECT_SOURCE_DIR}/ci/install-check.sh" "${LIBCHECK_PREFIX}"
TIMEOUT 300 # if this doesn't build in 5 minutes something is hosed
)
set(CHECK_ROOT_DIR "${LIBCHECK_PREFIX}")
set(CMAKE_REQUIRED_INCLUDES "${CHECK_ROOT_DIR}/include") # these make check link correctly in ccommon and pelikan
set(CMAKE_REQUIRED_LIBRARIES "${CHECK_ROOT_DIR}/lib")
endif()

set(CHECK_ROOT_DIR "${LIBCHECK_PREFIX}")
set(CMAKE_REQUIRED_INCLUDES "${CHECK_ROOT_DIR}/include") # these make check link correctly in ccommon and pelikan
set(CMAKE_REQUIRED_LIBRARIES "${CHECK_ROOT_DIR}/lib")

if(${OS_PLATFORM} MATCHES "OS_LINUX")
set(CFLAGS_LIST "${CFLAGS_LIST} -lrt")
endif()
Expand Down
2 changes: 1 addition & 1 deletion ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ trap cleanup EXIT

export PATH=$HOME/.cargo/bin:$PATH

mkdir -p _build && ( cd _build && cmake .. && make -j && make check ) || die 'make failed'
mkdir -p _build && ( cd _build && cmake -D BUILD_AND_INSTALL_CHECK=yes .. && make -j && make check ) || die 'make failed'

egrep -r ":F:|:E:" . |grep -v 'Binary file' || true

Expand Down

0 comments on commit 6851ff1

Please sign in to comment.