Commit 216a1831 authored by Manuel Pégourié-Gonnard's avatar Manuel Pégourié-Gonnard
Browse files

Fix whitespace in CMakeLists.txt

- all spaces no tabs
- indent with 4 spaces everywhere
parent e058ea2e
...@@ -4,26 +4,26 @@ project("mbed TLS" C) ...@@ -4,26 +4,26 @@ project("mbed TLS" C)
string(REGEX MATCH "Clang" CMAKE_COMPILER_IS_CLANG "${CMAKE_C_COMPILER_ID}") string(REGEX MATCH "Clang" CMAKE_COMPILER_IS_CLANG "${CMAKE_C_COMPILER_ID}")
if(CMAKE_COMPILER_IS_GNUCC) if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -W -Wdeclaration-after-statement -Wwrite-strings -Wlogical-op") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -W -Wdeclaration-after-statement -Wwrite-strings -Wlogical-op")
set(CMAKE_C_FLAGS_RELEASE "-O2") set(CMAKE_C_FLAGS_RELEASE "-O2")
set(CMAKE_C_FLAGS_DEBUG "-O0 -g3") set(CMAKE_C_FLAGS_DEBUG "-O0 -g3")
set(CMAKE_C_FLAGS_COVERAGE "-O0 -g3 --coverage") set(CMAKE_C_FLAGS_COVERAGE "-O0 -g3 --coverage")
set(CMAKE_C_FLAGS_ASAN "-Werror -fsanitize=address -fno-common -O3") set(CMAKE_C_FLAGS_ASAN "-Werror -fsanitize=address -fno-common -O3")
set(CMAKE_C_FLAGS_ASANDBG "-Werror -fsanitize=address -fno-common -O1 -g3 -fno-omit-frame-pointer -fno-optimize-sibling-calls ") set(CMAKE_C_FLAGS_ASANDBG "-Werror -fsanitize=address -fno-common -O1 -g3 -fno-omit-frame-pointer -fno-optimize-sibling-calls ")
set(CMAKE_C_FLAGS_CHECK "-Werror -Os") set(CMAKE_C_FLAGS_CHECK "-Werror -Os")
set(CMAKE_C_FLAGS_CHECKFULL "${CMAKE_C_FLAGS_CHECK} -Wcast-qual") set(CMAKE_C_FLAGS_CHECKFULL "${CMAKE_C_FLAGS_CHECK} -Wcast-qual")
endif(CMAKE_COMPILER_IS_GNUCC) endif(CMAKE_COMPILER_IS_GNUCC)
if(CMAKE_COMPILER_IS_CLANG) if(CMAKE_COMPILER_IS_CLANG)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -W -Wdeclaration-after-statement -Wwrite-strings -Wpointer-arith") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -W -Wdeclaration-after-statement -Wwrite-strings -Wpointer-arith")
set(CMAKE_C_FLAGS_RELEASE "-O2") set(CMAKE_C_FLAGS_RELEASE "-O2")
set(CMAKE_C_FLAGS_DEBUG "-O0 -g3") set(CMAKE_C_FLAGS_DEBUG "-O0 -g3")
set(CMAKE_C_FLAGS_COVERAGE "-O0 -g3 --coverage") set(CMAKE_C_FLAGS_COVERAGE "-O0 -g3 --coverage")
set(CMAKE_C_FLAGS_ASAN "-Werror -fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover -O3") set(CMAKE_C_FLAGS_ASAN "-Werror -fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover -O3")
set(CMAKE_C_FLAGS_ASANDBG "-Werror -fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover -O1 -g3 -fno-omit-frame-pointer -fno-optimize-sibling-calls ") set(CMAKE_C_FLAGS_ASANDBG "-Werror -fsanitize=address -fno-common -fsanitize=undefined -fno-sanitize-recover -O1 -g3 -fno-omit-frame-pointer -fno-optimize-sibling-calls ")
set(CMAKE_C_FLAGS_MEMSAN "-Werror -fsanitize=memory -O3") set(CMAKE_C_FLAGS_MEMSAN "-Werror -fsanitize=memory -O3")
set(CMAKE_C_FLAGS_MEMSANDBG "-Werror -fsanitize=memory -O1 -g3 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize-memory-track-origins=2") set(CMAKE_C_FLAGS_MEMSANDBG "-Werror -fsanitize=memory -O1 -g3 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize-memory-track-origins=2")
set(CMAKE_C_FLAGS_CHECK "-Werror -Os") set(CMAKE_C_FLAGS_CHECK "-Werror -Os")
endif(CMAKE_COMPILER_IS_CLANG) endif(CMAKE_COMPILER_IS_CLANG)
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE}
...@@ -31,9 +31,9 @@ set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} ...@@ -31,9 +31,9 @@ set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE}
FORCE) FORCE)
if(CMAKE_BUILD_TYPE STREQUAL "Coverage") if(CMAKE_BUILD_TYPE STREQUAL "Coverage")
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG) if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
set(CMAKE_SHARED_LINKER_FLAGS "--coverage") set(CMAKE_SHARED_LINKER_FLAGS "--coverage")
endif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG) endif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
endif(CMAKE_BUILD_TYPE STREQUAL "Coverage") endif(CMAKE_BUILD_TYPE STREQUAL "Coverage")
option(USE_PKCS11_HELPER_LIBRARY "Build mbed TLS with the pkcs11-helper library." OFF) option(USE_PKCS11_HELPER_LIBRARY "Build mbed TLS with the pkcs11-helper library." OFF)
...@@ -43,65 +43,65 @@ option(ENABLE_PROGRAMS "Build mbed TLS programs." ON) ...@@ -43,65 +43,65 @@ option(ENABLE_PROGRAMS "Build mbed TLS programs." ON)
option(ENABLE_TESTING "Build mbed TLS tests." ON) option(ENABLE_TESTING "Build mbed TLS tests." ON)
if(ENABLE_TESTING) if(ENABLE_TESTING)
enable_testing() enable_testing()
endif() endif()
if(LIB_INSTALL_DIR) if(LIB_INSTALL_DIR)
else() else()
set(LIB_INSTALL_DIR lib) set(LIB_INSTALL_DIR lib)
endif() endif()
include_directories(include/) include_directories(include/)
if(ENABLE_ZLIB_SUPPORT) if(ENABLE_ZLIB_SUPPORT)
find_package(ZLIB) find_package(ZLIB)
if(ZLIB_FOUND) if(ZLIB_FOUND)
include_directories(${ZLIB_INCLUDE_DIR}) include_directories(${ZLIB_INCLUDE_DIR})
endif(ZLIB_FOUND) endif(ZLIB_FOUND)
endif(ENABLE_ZLIB_SUPPORT) endif(ENABLE_ZLIB_SUPPORT)
add_subdirectory(library) add_subdirectory(library)
add_subdirectory(include) add_subdirectory(include)
if(ENABLE_TESTING) if(ENABLE_TESTING)
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG) if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
add_subdirectory(tests) add_subdirectory(tests)
endif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG) endif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
endif() endif()
if(ENABLE_PROGRAMS) if(ENABLE_PROGRAMS)
add_subdirectory(programs) add_subdirectory(programs)
endif() endif()
ADD_CUSTOM_TARGET(apidoc ADD_CUSTOM_TARGET(apidoc
COMMAND doxygen doxygen/mbedtls.doxyfile COMMAND doxygen doxygen/mbedtls.doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
if(ENABLE_TESTING) if(ENABLE_TESTING)
ADD_CUSTOM_TARGET(covtest ADD_CUSTOM_TARGET(covtest
COMMAND make test COMMAND make test
COMMAND programs/test/selftest COMMAND programs/test/selftest
COMMAND cd tests && ./compat.sh COMMAND cd tests && ./compat.sh
COMMAND cd tests && ./ssl-opt.sh COMMAND cd tests && ./ssl-opt.sh
) )
ADD_CUSTOM_TARGET(lcov ADD_CUSTOM_TARGET(lcov
COMMAND rm -rf Coverage COMMAND rm -rf Coverage
COMMAND lcov --capture --initial --directory library/CMakeFiles/mbedtls.dir -o files.info COMMAND lcov --capture --initial --directory library/CMakeFiles/mbedtls.dir -o files.info
COMMAND lcov --capture --directory library/CMakeFiles/mbedtls.dir -o tests.info COMMAND lcov --capture --directory library/CMakeFiles/mbedtls.dir -o tests.info
COMMAND lcov --add-tracefile files.info --add-tracefile tests.info -o all.info COMMAND lcov --add-tracefile files.info --add-tracefile tests.info -o all.info
COMMAND lcov --remove all.info -o final.info '*.h' COMMAND lcov --remove all.info -o final.info '*.h'
COMMAND gendesc tests/Descriptions.txt -o descriptions COMMAND gendesc tests/Descriptions.txt -o descriptions
COMMAND genhtml --title "mbed TLS" --description-file descriptions --keep-descriptions --legend --no-branch-coverage -o Coverage final.info COMMAND genhtml --title "mbed TLS" --description-file descriptions --keep-descriptions --legend --no-branch-coverage -o Coverage final.info
COMMAND rm -f files.info tests.info all.info final.info descriptions COMMAND rm -f files.info tests.info all.info final.info descriptions
) )
ADD_CUSTOM_TARGET(memcheck ADD_CUSTOM_TARGET(memcheck
COMMAND sed -i.bak s+/usr/bin/valgrind+`which valgrind`+ DartConfiguration.tcl COMMAND sed -i.bak s+/usr/bin/valgrind+`which valgrind`+ DartConfiguration.tcl
COMMAND ctest -O memcheck.log -D ExperimentalMemCheck COMMAND ctest -O memcheck.log -D ExperimentalMemCheck
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
COMMAND mv DartConfiguration.tcl.bak DartConfiguration.tcl COMMAND mv DartConfiguration.tcl.bak DartConfiguration.tcl
) )
endif() endif()
...@@ -2,9 +2,9 @@ option(INSTALL_MBEDTLS_HEADERS "Install mbed TLS headers." ON) ...@@ -2,9 +2,9 @@ option(INSTALL_MBEDTLS_HEADERS "Install mbed TLS headers." ON)
if(INSTALL_MBEDTLS_HEADERS) if(INSTALL_MBEDTLS_HEADERS)
file(GLOB headers "mbedtls/*.h") file(GLOB headers "mbedtls/*.h")
install(FILES ${headers} install(FILES ${headers}
DESTINATION include/mbedtls DESTINATION include/mbedtls
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
......
...@@ -87,62 +87,62 @@ set(src ...@@ -87,62 +87,62 @@ set(src
) )
if(WIN32) if(WIN32)
set(libs ws2_32) set(libs ws2_32)
endif(WIN32) endif(WIN32)
if(CMAKE_COMPILER_IS_GNUCC) if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-declarations -Wmissing-prototypes") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-declarations -Wmissing-prototypes")
endif(CMAKE_COMPILER_IS_GNUCC) endif(CMAKE_COMPILER_IS_GNUCC)
if(CMAKE_COMPILER_IS_CLANG) if(CMAKE_COMPILER_IS_CLANG)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-declarations -Wmissing-prototypes -Wdocumentation -Wno-documentation-deprecated-sync -Wunreachable-code") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-declarations -Wmissing-prototypes -Wdocumentation -Wno-documentation-deprecated-sync -Wunreachable-code")
endif(CMAKE_COMPILER_IS_CLANG) endif(CMAKE_COMPILER_IS_CLANG)
if (NOT USE_STATIC_MBEDTLS_LIBRARY AND NOT USE_SHARED_MBEDTLS_LIBRARY) if (NOT USE_STATIC_MBEDTLS_LIBRARY AND NOT USE_SHARED_MBEDTLS_LIBRARY)
message(FATAL_ERROR "Need to choose static or shared mbedtls build!") message(FATAL_ERROR "Need to choose static or shared mbedtls build!")
endif(NOT USE_STATIC_MBEDTLS_LIBRARY AND NOT USE_SHARED_MBEDTLS_LIBRARY) endif(NOT USE_STATIC_MBEDTLS_LIBRARY AND NOT USE_SHARED_MBEDTLS_LIBRARY)
if(USE_STATIC_MBEDTLS_LIBRARY AND USE_SHARED_MBEDTLS_LIBRARY) if(USE_STATIC_MBEDTLS_LIBRARY AND USE_SHARED_MBEDTLS_LIBRARY)
# if we build both static an shared, then let # if we build both static an shared, then let
# tests and programs link to the shared lib target # tests and programs link to the shared lib target
set(mbedtls_static_target "mbedtls_static") set(mbedtls_static_target "mbedtls_static")
elseif(USE_STATIC_MBEDTLS_LIBRARY) elseif(USE_STATIC_MBEDTLS_LIBRARY)
set(mbedtls_static_target "mbedtls") set(mbedtls_static_target "mbedtls")
endif() endif()
if(USE_STATIC_MBEDTLS_LIBRARY) if(USE_STATIC_MBEDTLS_LIBRARY)
add_library(${mbedtls_static_target} STATIC ${src}) add_library(${mbedtls_static_target} STATIC ${src})
set_target_properties(${mbedtls_static_target} PROPERTIES OUTPUT_NAME mbedtls) set_target_properties(${mbedtls_static_target} PROPERTIES OUTPUT_NAME mbedtls)
target_link_libraries(${mbedtls_static_target} ${libs}) target_link_libraries(${mbedtls_static_target} ${libs})
if(ZLIB_FOUND) if(ZLIB_FOUND)
target_link_libraries(${mbedtls_static_target} ${ZLIB_LIBRARIES}) target_link_libraries(${mbedtls_static_target} ${ZLIB_LIBRARIES})
endif(ZLIB_FOUND) endif(ZLIB_FOUND)
if(LINK_WITH_PTHREAD) if(LINK_WITH_PTHREAD)
target_link_libraries(${mbedtls_static_target} pthread) target_link_libraries(${mbedtls_static_target} pthread)
endif() endif()
install(TARGETS ${mbedtls_static_target} install(TARGETS ${mbedtls_static_target}
DESTINATION ${LIB_INSTALL_DIR} DESTINATION ${LIB_INSTALL_DIR}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
endif() endif()
if(USE_SHARED_MBEDTLS_LIBRARY) if(USE_SHARED_MBEDTLS_LIBRARY)
add_library(mbedtls SHARED ${src}) add_library(mbedtls SHARED ${src})
set_target_properties(mbedtls PROPERTIES VERSION 1.4.0 SOVERSION 8) set_target_properties(mbedtls PROPERTIES VERSION 1.4.0 SOVERSION 8)
target_link_libraries(mbedtls ${libs}) target_link_libraries(mbedtls ${libs})
if(ZLIB_FOUND) if(ZLIB_FOUND)
target_link_libraries(mbedtls ${ZLIB_LIBRARIES}) target_link_libraries(mbedtls ${ZLIB_LIBRARIES})
endif(ZLIB_FOUND) endif(ZLIB_FOUND)
if(LINK_WITH_PTHREAD) if(LINK_WITH_PTHREAD)
target_link_libraries(mbedtls pthread) target_link_libraries(mbedtls pthread)
endif() endif()
install(TARGETS mbedtls install(TARGETS mbedtls
DESTINATION ${LIB_INSTALL_DIR} DESTINATION ${LIB_INSTALL_DIR}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
endif(USE_SHARED_MBEDTLS_LIBRARY) endif(USE_SHARED_MBEDTLS_LIBRARY)
...@@ -2,18 +2,18 @@ set(THREADS_USE_PTHREADS_WIN32 true) ...@@ -2,18 +2,18 @@ set(THREADS_USE_PTHREADS_WIN32 true)
find_package(Threads) find_package(Threads)
set(libs set(libs
mbedtls mbedtls
) )
set(targets set(targets
dtls_client dtls_client
dtls_server dtls_server
ssl_client1 ssl_client1
ssl_client2 ssl_client2
ssl_server ssl_server
ssl_fork_server ssl_fork_server
ssl_mail_client ssl_mail_client
mini_client mini_client
) )
if(USE_PKCS11_HELPER_LIBRARY) if(USE_PKCS11_HELPER_LIBRARY)
......
set(libs set(libs
mbedtls mbedtls
) )
if(USE_PKCS11_HELPER_LIBRARY) if(USE_PKCS11_HELPER_LIBRARY)
......
set(libs set(libs
mbedtls mbedtls
) )
add_executable(strerror strerror.c) add_executable(strerror strerror.c)
......
set(libs set(libs
mbedtls mbedtls
) )
if(USE_PKCS11_HELPER_LIBRARY) if(USE_PKCS11_HELPER_LIBRARY)
......
set(libs set(libs
mbedtls mbedtls
) )
if(USE_PKCS11_HELPER_LIBRARY) if(USE_PKCS11_HELPER_LIBRARY)
...@@ -12,9 +12,9 @@ endif(ENABLE_ZLIB_SUPPORT) ...@@ -12,9 +12,9 @@ endif(ENABLE_ZLIB_SUPPORT)
function(add_test_suite suite_name) function(add_test_suite suite_name)
if(ARGV1) if(ARGV1)
set(data_name ${ARGV1}) set(data_name ${ARGV1})
else() else()
set(data_name ${suite_name}) set(data_name ${suite_name})
endif() endif()
add_custom_command( add_custom_command(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment