aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2018-03-07 11:35:33 -0800
committerGerald Combs <gerald@wireshark.org>2018-03-07 23:27:06 +0000
commit39a65995ccaa45322b7ee870fe21a0daa6157242 (patch)
treef49835f5cb69dcb1510eaad6865570ea1e327056
parenteefa76a7c810bd74d95d571362f0ad5fda691e70 (diff)
CMake: Exclude test targets from the default build.
For the Visual Studio generator, setting the EXCLUDE_FROM_ALL property on a target excludes it from ALL_BUILD.vcxproj, but we additionally need to set EXCLUDE_FROM_DEFAULT_BUILD to exclude it from Wireshark.sln. Do so for the test targets. Change-Id: Icd328f75d4927e5b7bb65b1833da4724f63476b6 Reviewed-on: https://code.wireshark.org/review/26345 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
-rw-r--r--CMakeLists.txt30
-rw-r--r--epan/CMakeLists.txt4
2 files changed, 22 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5c7c549d16..dd394501c7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3132,7 +3132,24 @@ add_custom_target(test-sh
-P ${CMAKE_SOURCE_DIR}/cmake/modules/GenerateTestSh.cmake
DEPENDS ${CMAKE_SOURCE_DIR}/cmake/modules/GenerateTestSh.cmake
)
-set_target_properties(test-sh PROPERTIES FOLDER "Tests")
+set_target_properties(test-sh PROPERTIES
+ FOLDER "Tests"
+ EXCLUDE_FROM_DEFAULT_BUILD True
+)
+
+add_custom_target(test-programs
+ DEPENDS test-sh
+ exntest
+ oids_test
+ reassemble_test
+ tvbtest
+ wmem_test
+ COMMENT "Building unit test programs and wrapper"
+)
+set_target_properties(test-programs PROPERTIES
+ FOLDER "Tests"
+ EXCLUDE_FROM_DEFAULT_BUILD True
+)
if (GIT_EXECUTABLE)
# Update AUTHORS file with entries from git shortlog
@@ -3146,17 +3163,6 @@ else (GIT_EXECUTABLE)
endif (GIT_EXECUTABLE)
set_target_properties(gen-authors PROPERTIES FOLDER "Docs")
-add_custom_target(test-programs
- DEPENDS test-sh
- exntest
- oids_test
- reassemble_test
- tvbtest
- wmem_test
- COMMENT "Building unit test programs and wrapper"
-)
-set_target_properties(test-programs PROPERTIES FOLDER "Tests")
-
if (WIN32)
file (TO_NATIVE_PATH ${CMAKE_SOURCE_DIR}/tools/Get-HardenFlags.ps1 _win_harden_flags)
add_custom_target(hardening-check
diff --git a/epan/CMakeLists.txt b/epan/CMakeLists.txt
index 589cf94804..603923753a 100644
--- a/epan/CMakeLists.txt
+++ b/epan/CMakeLists.txt
@@ -395,6 +395,7 @@ add_executable(exntest EXCLUDE_FROM_ALL exntest.c except.c)
target_link_libraries(exntest ${GLIB2_LIBRARIES})
set_target_properties(exntest PROPERTIES
FOLDER "Tests"
+ EXCLUDE_FROM_DEFAULT_BUILD True
COMPILE_DEFINITIONS "WS_BUILD_DLL"
)
@@ -402,6 +403,7 @@ add_executable(oids_test EXCLUDE_FROM_ALL oids_test.c)
target_link_libraries(oids_test epan ${ZLIB_LIBRARIES})
set_target_properties(oids_test PROPERTIES
FOLDER "Tests"
+ EXCLUDE_FROM_DEFAULT_BUILD True
COMPILE_DEFINITIONS "WS_BUILD_DLL"
)
@@ -409,12 +411,14 @@ add_executable(reassemble_test EXCLUDE_FROM_ALL reassemble_test.c)
target_link_libraries(reassemble_test epan)
set_target_properties(reassemble_test PROPERTIES
FOLDER "Tests"
+ EXCLUDE_FROM_DEFAULT_BUILD True
)
add_executable(tvbtest EXCLUDE_FROM_ALL tvbtest.c)
target_link_libraries(tvbtest epan)
set_target_properties(tvbtest PROPERTIES
FOLDER "Tests"
+ EXCLUDE_FROM_DEFAULT_BUILD True
COMPILE_DEFINITIONS "WS_BUILD_DLL"
)