加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0007-add-cmake-option-for-test-and-binary.patch 1.58 KB
一键复制 编辑 原始数据 按行查看 历史
haozi007 提交于 2022-06-08 07:30 . add index and cmake options
From 255917e92717c491ffb66eb63a3333682d13df60 Mon Sep 17 00:00:00 2001
From: haozi007 <liuhao27@huawei.com>
Date: Wed, 8 Jun 2022 07:27:46 +0100
Subject: [PATCH] add cmake option for test and binary
Signed-off-by: haozi007 <liuhao27@huawei.com>
---
CMakeLists.txt | 27 ++++++++++++++++++---------
1 file changed, 18 insertions(+), 9 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4c0a9be..9cc63c5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -64,18 +64,27 @@ ENDIF (WIN32)
ADD_SUBDIRECTORY(src)
-ADD_SUBDIRECTORY(test)
-ADD_SUBDIRECTORY(reformatter)
-ADD_SUBDIRECTORY(verify)
+
+IF (NOT DISABLE_TEST)
+ ADD_SUBDIRECTORY(test)
+ENDIF ()
+
+IF (NOT DISABLE_BIN)
+ ADD_SUBDIRECTORY(reformatter)
+ ADD_SUBDIRECTORY(verify)
+ENDIF ()
+
ADD_SUBDIRECTORY(example)
ADD_SUBDIRECTORY(perf)
INCLUDE(YAJLDoc.cmake)
-# a test target
-ADD_CUSTOM_TARGET(test
- ./run_tests.sh ${CMAKE_CURRENT_BINARY_DIR}/test/parsing/yajl_test
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test/parsing)
+IF (NOT DISABLE_TEST)
+ # a test target
+ ADD_CUSTOM_TARGET(test
+ ./run_tests.sh ${CMAKE_CURRENT_BINARY_DIR}/test/parsing/yajl_test
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test/parsing)
-ADD_CUSTOM_TARGET(test-api ${CMAKE_CURRENT_SOURCE_DIR}/test/api/run_tests.sh
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test/api)
+ ADD_CUSTOM_TARGET(test-api ${CMAKE_CURRENT_SOURCE_DIR}/test/api/run_tests.sh
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test/api)
+ENDIF ()
--
2.20.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化