Skip to content

Commit

Permalink
Add all compile options to CMakeLists
Browse files Browse the repository at this point in the history
They will now show up in ccmake.
  • Loading branch information
Manu Goyal authored and Manu Goyal committed Dec 31, 2017
1 parent e4b7e35 commit 11080cc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ set(libcuckoo_VERSION_PATCH 0)

# put these in the cache so they show up in ccmake
option (BUILD_EXAMPLES "build example libcuckoo programs")
option (BUILD_TESTS "build libcuckoo test programs")

# Add the libcuckoo interface target
add_subdirectory(libcuckoo)
Expand Down
6 changes: 6 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ target_include_directories(test_util INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
)

# put these in the cache so they show up in ccmake
option (BUILD_TESTS "build all libcuckoo tests")
option (BUILD_STRESS_TESTS "build the stress tests")
option (BUILD_UNIT_TESTS "build the unit tests")
option (BUILD_UNIVERSAL_BENCHMARK "build the universal benchmark and associated tests")

# Add pcg if we're doing stress tests or universal benchmark
if (BUILD_TESTS OR
BUILD_STRESS_TESTS OR
Expand Down
18 changes: 6 additions & 12 deletions tests/universal-benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
add_executable(universal_benchmark universal_benchmark.cc)

# put these in the cache so they show up in ccmake
set (UNIVERSAL_KEY uint64_t CACHE STRING "set the key type used by the universal benchmark")
set (UNIVERSAL_VALUE uint64_t CACHE STRING "set the value type used by the universal benchmark")
set (UNIVERSAL_TABLE LIBCUCKOO CACHE STRING "set the table type used by the universal benchmark")
option (UNIVERSAL_TRACKING_ALLOCATOR "if on, also sample memory usage in the universal benchmark")

target_link_libraries(universal_benchmark
PRIVATE test_util
PRIVATE libcuckoo
PRIVATE pcg
)

if(NOT DEFINED UNIVERSAL_KEY)
set(UNIVERSAL_KEY uint64_t)
endif()

if(NOT DEFINED UNIVERSAL_VALUE)
set(UNIVERSAL_VALUE uint64_t)
endif()

if(NOT DEFINED UNIVERSAL_TABLE)
set(UNIVERSAL_TABLE LIBCUCKOO)
endif()

target_compile_options(universal_benchmark
PRIVATE -DKEY=${UNIVERSAL_KEY}
PRIVATE -DVALUE=${UNIVERSAL_VALUE}
Expand Down
2 changes: 1 addition & 1 deletion tests/universal-benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ new keys can be added in `universal_gen.hh`
`LIBCUCKOO`). Support for new maps can be added in
`universal_table_wrapper.hh`

`-DTRACKING_ALLOCATOR`
`-DUNIVERSAL_TRACKING_ALLOCATOR`
: enables memory usage sampling

These flags control the mixture of operations that will be run in the
Expand Down

0 comments on commit 11080cc

Please sign in to comment.