mirror of
https://github.com/yuzu-emu/mbedtls
synced 2024-11-24 13:58:13 +00:00
Add option to CMake to disable all tests
This commit is contained in:
parent
c16f4e1f78
commit
27f1caed02
1 changed files with 22 additions and 15 deletions
|
@ -1,8 +1,6 @@
|
||||||
cmake_minimum_required(VERSION 2.6)
|
cmake_minimum_required(VERSION 2.6)
|
||||||
project(POLARSSL C)
|
project(POLARSSL C)
|
||||||
|
|
||||||
enable_testing()
|
|
||||||
|
|
||||||
string(REGEX MATCH "clang" CMAKE_COMPILER_IS_CLANG "${CMAKE_C_COMPILER}")
|
string(REGEX MATCH "clang" CMAKE_COMPILER_IS_CLANG "${CMAKE_C_COMPILER}")
|
||||||
|
|
||||||
if(CMAKE_COMPILER_IS_GNUCC)
|
if(CMAKE_COMPILER_IS_GNUCC)
|
||||||
|
@ -41,6 +39,11 @@ option(USE_PKCS11_HELPER_LIBRARY "Build PolarSSL with the pkcs11-helper library.
|
||||||
|
|
||||||
option(ENABLE_ZLIB_SUPPORT "Build PolarSSL with zlib library." OFF)
|
option(ENABLE_ZLIB_SUPPORT "Build PolarSSL with zlib library." OFF)
|
||||||
option(ENABLE_PROGRAMS "Build PolarSSL programs." ON)
|
option(ENABLE_PROGRAMS "Build PolarSSL programs." ON)
|
||||||
|
option(ENABLE_TESTING "Build PolarSSL tests." ON)
|
||||||
|
|
||||||
|
if(ENABLE_TESTING)
|
||||||
|
enable_testing()
|
||||||
|
endif()
|
||||||
|
|
||||||
if(LIB_INSTALL_DIR)
|
if(LIB_INSTALL_DIR)
|
||||||
else()
|
else()
|
||||||
|
@ -60,12 +63,14 @@ endif(ENABLE_ZLIB_SUPPORT)
|
||||||
add_subdirectory(library)
|
add_subdirectory(library)
|
||||||
add_subdirectory(include)
|
add_subdirectory(include)
|
||||||
|
|
||||||
|
if(ENABLE_TESTING)
|
||||||
if(CMAKE_COMPILER_IS_GNUCC)
|
if(CMAKE_COMPILER_IS_GNUCC)
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
endif(CMAKE_COMPILER_IS_GNUCC)
|
endif(CMAKE_COMPILER_IS_GNUCC)
|
||||||
if(CMAKE_COMPILER_IS_CLANG)
|
if(CMAKE_COMPILER_IS_CLANG)
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
endif(CMAKE_COMPILER_IS_CLANG)
|
endif(CMAKE_COMPILER_IS_CLANG)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(ENABLE_PROGRAMS)
|
if(ENABLE_PROGRAMS)
|
||||||
add_subdirectory(programs)
|
add_subdirectory(programs)
|
||||||
|
@ -75,6 +80,7 @@ ADD_CUSTOM_TARGET(apidoc
|
||||||
COMMAND doxygen doxygen/polarssl.doxyfile
|
COMMAND doxygen doxygen/polarssl.doxyfile
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
|
if(ENABLE_TESTING)
|
||||||
ADD_CUSTOM_TARGET(test-ref-config
|
ADD_CUSTOM_TARGET(test-ref-config
|
||||||
COMMAND tests/scripts/test-ref-configs.pl
|
COMMAND tests/scripts/test-ref-configs.pl
|
||||||
)
|
)
|
||||||
|
@ -102,3 +108,4 @@ ADD_CUSTOM_TARGET(memcheck
|
||||||
COMMAND tail -n1 memcheck.log | grep 'Memory checking results:' > /dev/null
|
COMMAND tail -n1 memcheck.log | grep 'Memory checking results:' > /dev/null
|
||||||
COMMAND rm -f memcheck.log
|
COMMAND rm -f memcheck.log
|
||||||
)
|
)
|
||||||
|
endif()
|
||||||
|
|
Loading…
Reference in a new issue