Skip to content

Commit

Permalink
cmake: adding THRILL_BUILD_EXAMPLES and THRILL_BUILD_TESTS switches, …
Browse files Browse the repository at this point in the history
…fixes issue when using thrill as library
  • Loading branch information
bingmann committed Dec 22, 2016
1 parent 53adbd6 commit 7e3b186
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ before_script:
-DCMAKE_BUILD_TYPE="$BUILD_TYPE"
-DCMAKE_C_COMPILER="$CMAKE_CC" -DCMAKE_CXX_COMPILER="$CMAKE_CXX"
-DCMAKE_C_FLAGS="$COMPILER_FLAGS" -DCMAKE_CXX_FLAGS="$COMPILER_FLAGS"
-DTHRILL_BUILD_EXAMPLES=ON -DTHRILL_BUILD_TESTS=ON
$CMAKE_ARGS ..

script:
Expand Down
31 changes: 22 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type")
endif()

################################################################################
### Options and Switches

# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to
# make it prominent in the GUI.
option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)

option(THRILL_BUILD_EXAMPLES "Build thrill's examples." OFF)

option(THRILL_BUILD_TESTS "Build thrill's tests and benchmarks." OFF)

# THRILL_USE_ZLIB tristate switch
set(THRILL_USE_ZLIB AUTO CACHE
STRING "Use (optional) zlib for transparent .gz compression/decompression.")
Expand Down Expand Up @@ -75,9 +86,7 @@ set_property(CACHE THRILL_USE_S3 PROPERTY STRINGS AUTO ON OFF)
option(THRILL_USE_HDFS3
"Download and build with libhdfs3 for hdfs:// support." OFF)

# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to
# make it prominent in the GUI.
option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
################################################################################

# variables to collect compile-time definitions, include dirs, and libraries
set(THRILL_DEFINITIONS "")
Expand Down Expand Up @@ -618,14 +627,18 @@ endmacro(thrill_test_multiple)
# descend into library source
add_subdirectory(thrill)

# descend into testsuite
add_subdirectory(tests)
if(THRILL_BUILD_TESTS)
# descend into testsuite
add_subdirectory(tests)

# descend into benchmarks and examples programs
add_subdirectory(benchmarks)
# descend into benchmarks and examples programs
add_subdirectory(benchmarks)
endif()

# descend into examples source
add_subdirectory(examples)
if(THRILL_BUILD_EXAMPLES)
# descend into examples source
add_subdirectory(examples)
endif()

# build frontends
add_subdirectory(frontends)
Expand Down
2 changes: 1 addition & 1 deletion compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set -ex
git submodule init
git submodule update

CMAKE_OPTS=
CMAKE_OPTS="-DTHRILL_BUILD_EXAMPLES=ON -DTHRILL_BUILD_TESTS=ON"

# try to find a modern C++ compiler
set +x
Expand Down

0 comments on commit 7e3b186

Please sign in to comment.