[Beignet] [PATCH] CMAKE: Make utests and benchmark not build for default
Xiuli Pan
xiuli.pan at intel.com
Wed Jul 13 07:23:52 UTC 2016
From: Pan Xiuli <xiuli.pan at intel.com>
Now make will only make beignet library, if you want beignet utest or
benchmark you can use make utest and make benchmark to build them.
This will make build time for beignet shorter when utests are not
needed.
Signed-off-by: Pan Xiuli <xiuli.pan at intel.com>
---
CMakeLists.txt | 4 ++--
benchmark/CMakeLists.txt | 1 +
utests/CMakeLists.txt | 1 +
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a9e8abe..f5b179f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -276,11 +276,11 @@ ENDIF(BUILD_EXAMPLES)
ADD_SUBDIRECTORY(include)
ADD_SUBDIRECTORY(backend)
ADD_SUBDIRECTORY(src)
-ADD_SUBDIRECTORY(utests)
+ADD_SUBDIRECTORY(utests EXCLUDE_FROM_ALL)
# compile benchmark only if standalone compiler is not provided
IF (NOT (USE_STANDALONE_GBE_COMPILER STREQUAL "true"))
-ADD_SUBDIRECTORY(benchmark)
+ ADD_SUBDIRECTORY(benchmark EXCLUDE_FROM_ALL)
ENDIF (NOT (USE_STANDALONE_GBE_COMPILER STREQUAL "true"))
IF(BUILD_EXAMPLES)
diff --git a/benchmark/CMakeLists.txt b/benchmark/CMakeLists.txt
index 4319ccc..34305e7 100644
--- a/benchmark/CMakeLists.txt
+++ b/benchmark/CMakeLists.txt
@@ -32,3 +32,4 @@ TARGET_LINK_LIBRARIES(benchmarks cl m)
ADD_EXECUTABLE(benchmark_run benchmark_run.cpp)
TARGET_LINK_LIBRARIES(benchmark_run benchmarks)
+ADD_CUSTOM_TARGET(benchmark DEPENDS benchmarks benchmark_run)
diff --git a/utests/CMakeLists.txt b/utests/CMakeLists.txt
index f56c497..60317a5 100644
--- a/utests/CMakeLists.txt
+++ b/utests/CMakeLists.txt
@@ -375,3 +375,4 @@ ADD_DEPENDENCIES (utests utest_generator)
ADD_EXECUTABLE(flat_address_space runtime_flat_address_space.cpp)
TARGET_LINK_LIBRARIES(flat_address_space utests)
+ADD_CUSTOM_TARGET(utest DEPENDS utest_run utests flat_address_space)
--
2.5.0
More information about the Beignet
mailing list