Skip to content

Commit

Permalink
Reorder dependency includes in cmake, don't parallel build (twitter#182)
Browse files Browse the repository at this point in the history
Fix the build by including dependencies in the top-level CMakeLists.txt in the correct order
  • Loading branch information
slyphon authored Nov 20, 2018
1 parent a6a54d9 commit 2ef0163
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
21 changes: 13 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
cmake_minimum_required(VERSION 2.6)
project(ccommon C)

# Uncomment the following to output dependency graph debugging messages
# set_property(GLOBAL PROPERTY GLOBAL_DEPENDS_DEBUG_MODE 1)

enable_testing()

###################
Expand Down Expand Up @@ -157,24 +160,26 @@ include_directories(
"${PROJECT_BINARY_DIR}"
"include")

if(HAVE_RUST)
enable_language(Rust)
include(CMakeCargo)
add_subdirectory(rust)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHAVE_RUST=1")
endif()


###################
# things to build #
###################

add_subdirectory(src)

if(CHECK_WORKING)
include_directories(${include_directories} "${CHECK_INCLUDES}")
add_subdirectory(test)
endif(CHECK_WORKING)


if(HAVE_RUST)
enable_language(Rust)
include(CMakeCargo)
add_subdirectory(rust)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHAVE_RUST=1")
endif()


###################
# print a summary #
###################
Expand Down
2 changes: 1 addition & 1 deletion ci/local-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ BUILD_DIR="${BUILD_DIR:-$TEMP}"
mkdir -p "$BUILD_DIR" && (
cd "$BUILD_DIR" &&
cmake "${CMAKEFLAGS[@]}" "$TOPLEVEL" &&
make -j all &&
make all &&
make check &&
cd rust &&
cargo test
Expand Down

0 comments on commit 2ef0163

Please sign in to comment.