aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Zakrzewski <slither.jz@gmail.com>2016-09-04 12:58:35 +0200
committerJakub Zakrzewski <slither.jz@gmail.com>2016-09-10 00:35:38 +0200
commit257bf3ac67eb6267c6185af79247daf0c8d744d6 (patch)
tree8846a90cba75d28c3d6f49210db787261d6534f6
parent6140dfcf3e7845f11dee755de6865379aa96dab7 (diff)
CMake: Don't build unit tests if private symbols are hidden
This only excludes building unit tests from default build ( 'all' Make target or "Build Solution" in VisualStudio). The projects and Make targets will still be generated and shown in supporting IDEs. Fixes https://github.com/curl/curl/issues/981 Reported-by: Randy Armstrong Closes https://github.com/curl/curl/pull/990
-rw-r--r--tests/unit/CMakeLists.txt14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt
index e66679882..14589d68d 100644
--- a/tests/unit/CMakeLists.txt
+++ b/tests/unit/CMakeLists.txt
@@ -40,7 +40,15 @@ foreach(_testfile ${UT_SRC})
set_target_properties(${_testname}
PROPERTIES COMPILE_DEFINITIONS "UNITTESTS")
- add_test(NAME ${_testname}
- COMMAND ${_testname} "http://www.google.com"
- )
+ if(HIDES_CURL_PRIVATE_SYMBOLS)
+ set_target_properties(${_testname}
+ PROPERTIES
+ EXCLUDE_FROM_ALL TRUE
+ EXCLUDE_FROM_DEFAULT_BUILD TRUE
+ )
+ else()
+ add_test(NAME ${_testname}
+ COMMAND ${_testname} "http://www.google.com"
+ )
+ endif()
endforeach()