mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-22 19:05:32 +00:00
Rename project in CMake
TODO: to create symlinks to the old names!
This commit is contained in:
parent
5285970871
commit
9014b6f227
|
@ -1,5 +1,5 @@
|
|||
cmake_minimum_required(VERSION 2.6)
|
||||
project(POLARSSL C)
|
||||
project(MBEDTLS C)
|
||||
|
||||
string(REGEX MATCH "Clang" CMAKE_COMPILER_IS_CLANG "${CMAKE_C_COMPILER_ID}")
|
||||
|
||||
|
@ -98,8 +98,8 @@ if(ENABLE_TESTING)
|
|||
|
||||
ADD_CUSTOM_TARGET(lcov
|
||||
COMMAND rm -rf Coverage
|
||||
COMMAND lcov --capture --initial --directory library/CMakeFiles/polarssl.dir -o files.info
|
||||
COMMAND lcov --capture --directory library/CMakeFiles/polarssl.dir -o tests.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 --add-tracefile files.info --add-tracefile tests.info -o all.info
|
||||
COMMAND lcov --remove all.info -o final.info '*.h'
|
||||
COMMAND gendesc tests/Descriptions.txt -o descriptions
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
option(INSTALL_POLARSSL_HEADERS "Install mbed TLS headers." ON)
|
||||
option(INSTALL_MBEDTLS_HEADERS "Install mbed TLS headers." ON)
|
||||
|
||||
if(INSTALL_POLARSSL_HEADERS)
|
||||
if(INSTALL_MBEDTLS_HEADERS)
|
||||
|
||||
file(GLOB headers "polarssl/*.h")
|
||||
|
||||
|
@ -8,4 +8,4 @@ install(FILES ${headers}
|
|||
DESTINATION include/polarssl
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
|
||||
|
||||
endif(INSTALL_POLARSSL_HEADERS)
|
||||
endif(INSTALL_MBEDTLS_HEADERS)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
option(USE_STATIC_POLARSSL_LIBRARY "Build mbed TLS static library." ON)
|
||||
option(USE_SHARED_POLARSSL_LIBRARY "Build mbed TLS shared library." OFF)
|
||||
option(USE_STATIC_MBEDTLS_LIBRARY "Build mbed TLS static library." ON)
|
||||
option(USE_SHARED_MBEDTLS_LIBRARY "Build mbed TLS shared library." OFF)
|
||||
option(LINK_WITH_PTHREAD "Explicitly link mbed TLS library to pthread." OFF)
|
||||
|
||||
set(src
|
||||
|
@ -85,51 +85,51 @@ if(CMAKE_COMPILER_IS_CLANG)
|
|||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-declarations -Wmissing-prototypes -Wdocumentation -Wunreachable-code")
|
||||
endif(CMAKE_COMPILER_IS_CLANG)
|
||||
|
||||
if (NOT USE_STATIC_POLARSSL_LIBRARY AND NOT USE_SHARED_POLARSSL_LIBRARY)
|
||||
message(FATAL_ERROR "Need to choose static or shared polarssl build!")
|
||||
endif(NOT USE_STATIC_POLARSSL_LIBRARY AND NOT USE_SHARED_POLARSSL_LIBRARY)
|
||||
if (NOT USE_STATIC_MBEDTLS_LIBRARY AND NOT USE_SHARED_MBEDTLS_LIBRARY)
|
||||
message(FATAL_ERROR "Need to choose static or shared mbedtls build!")
|
||||
endif(NOT USE_STATIC_MBEDTLS_LIBRARY AND NOT USE_SHARED_MBEDTLS_LIBRARY)
|
||||
|
||||
if(USE_STATIC_POLARSSL_LIBRARY AND USE_SHARED_POLARSSL_LIBRARY)
|
||||
if(USE_STATIC_MBEDTLS_LIBRARY AND USE_SHARED_MBEDTLS_LIBRARY)
|
||||
# if we build both static an shared, then let
|
||||
# tests and programs link to the shared lib target
|
||||
set(polarssl_static_target "polarssl_static")
|
||||
elseif(USE_STATIC_POLARSSL_LIBRARY)
|
||||
set(polarssl_static_target "polarssl")
|
||||
set(mbedtls_static_target "mbedtls_static")
|
||||
elseif(USE_STATIC_MBEDTLS_LIBRARY)
|
||||
set(mbedtls_static_target "mbedtls")
|
||||
endif()
|
||||
|
||||
if(USE_STATIC_POLARSSL_LIBRARY)
|
||||
add_library(${polarssl_static_target} STATIC ${src})
|
||||
set_target_properties(${polarssl_static_target} PROPERTIES OUTPUT_NAME polarssl)
|
||||
target_link_libraries(${polarssl_static_target} ${libs})
|
||||
if(USE_STATIC_MBEDTLS_LIBRARY)
|
||||
add_library(${mbedtls_static_target} STATIC ${src})
|
||||
set_target_properties(${mbedtls_static_target} PROPERTIES OUTPUT_NAME mbedtls)
|
||||
target_link_libraries(${mbedtls_static_target} ${libs})
|
||||
|
||||
if(ZLIB_FOUND)
|
||||
target_link_libraries(${polarssl_static_target} ${ZLIB_LIBRARIES})
|
||||
target_link_libraries(${mbedtls_static_target} ${ZLIB_LIBRARIES})
|
||||
endif(ZLIB_FOUND)
|
||||
|
||||
if(LINK_WITH_PTHREAD)
|
||||
target_link_libraries(${polarssl_static_target} pthread)
|
||||
target_link_libraries(${mbedtls_static_target} pthread)
|
||||
endif()
|
||||
|
||||
install(TARGETS ${polarssl_static_target}
|
||||
install(TARGETS ${mbedtls_static_target}
|
||||
DESTINATION ${LIB_INSTALL_DIR}
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
endif()
|
||||
|
||||
if(USE_SHARED_POLARSSL_LIBRARY)
|
||||
add_library(polarssl SHARED ${src})
|
||||
set_target_properties(polarssl PROPERTIES VERSION 1.3.9 SOVERSION 7)
|
||||
if(USE_SHARED_MBEDTLS_LIBRARY)
|
||||
add_library(mbedtls SHARED ${src})
|
||||
set_target_properties(mbedtls PROPERTIES VERSION 1.3.9 SOVERSION 7)
|
||||
|
||||
target_link_libraries(polarssl ${libs})
|
||||
target_link_libraries(mbedtls ${libs})
|
||||
|
||||
if(ZLIB_FOUND)
|
||||
target_link_libraries(polarssl ${ZLIB_LIBRARIES})
|
||||
target_link_libraries(mbedtls ${ZLIB_LIBRARIES})
|
||||
endif(ZLIB_FOUND)
|
||||
|
||||
if(LINK_WITH_PTHREAD)
|
||||
target_link_libraries(polarssl pthread)
|
||||
target_link_libraries(mbedtls pthread)
|
||||
endif()
|
||||
|
||||
install(TARGETS polarssl
|
||||
install(TARGETS mbedtls
|
||||
DESTINATION ${LIB_INSTALL_DIR}
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
endif(USE_SHARED_POLARSSL_LIBRARY)
|
||||
endif(USE_SHARED_MBEDTLS_LIBRARY)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
add_executable(aescrypt2 aescrypt2.c)
|
||||
target_link_libraries(aescrypt2 polarssl)
|
||||
target_link_libraries(aescrypt2 mbedtls)
|
||||
|
||||
add_executable(crypt_and_hash crypt_and_hash.c)
|
||||
target_link_libraries(crypt_and_hash polarssl)
|
||||
target_link_libraries(crypt_and_hash mbedtls)
|
||||
|
||||
install(TARGETS aescrypt2 crypt_and_hash
|
||||
DESTINATION "bin"
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
add_executable(hello hello.c)
|
||||
target_link_libraries(hello polarssl)
|
||||
target_link_libraries(hello mbedtls)
|
||||
|
||||
add_executable(generic_sum generic_sum.c)
|
||||
target_link_libraries(generic_sum polarssl)
|
||||
target_link_libraries(generic_sum mbedtls)
|
||||
|
||||
add_executable(md5sum md5sum.c)
|
||||
target_link_libraries(md5sum polarssl)
|
||||
target_link_libraries(md5sum mbedtls)
|
||||
|
||||
add_executable(sha1sum sha1sum.c)
|
||||
target_link_libraries(sha1sum polarssl)
|
||||
target_link_libraries(sha1sum mbedtls)
|
||||
|
||||
add_executable(sha2sum sha2sum.c)
|
||||
target_link_libraries(sha2sum polarssl)
|
||||
target_link_libraries(sha2sum mbedtls)
|
||||
|
||||
install(TARGETS hello md5sum sha1sum sha2sum generic_sum
|
||||
DESTINATION "bin"
|
||||
|
|
|
@ -1,59 +1,59 @@
|
|||
add_executable(dh_client dh_client.c)
|
||||
target_link_libraries(dh_client polarssl)
|
||||
target_link_libraries(dh_client mbedtls)
|
||||
|
||||
add_executable(dh_genprime dh_genprime.c)
|
||||
target_link_libraries(dh_genprime polarssl)
|
||||
target_link_libraries(dh_genprime mbedtls)
|
||||
|
||||
add_executable(dh_server dh_server.c)
|
||||
target_link_libraries(dh_server polarssl)
|
||||
target_link_libraries(dh_server mbedtls)
|
||||
|
||||
add_executable(ecdsa ecdsa.c)
|
||||
target_link_libraries(ecdsa polarssl)
|
||||
target_link_libraries(ecdsa mbedtls)
|
||||
|
||||
add_executable(gen_key gen_key.c)
|
||||
target_link_libraries(gen_key polarssl)
|
||||
target_link_libraries(gen_key mbedtls)
|
||||
|
||||
add_executable(key_app key_app.c)
|
||||
target_link_libraries(key_app polarssl)
|
||||
target_link_libraries(key_app mbedtls)
|
||||
|
||||
add_executable(key_app_writer key_app_writer.c)
|
||||
target_link_libraries(key_app_writer polarssl)
|
||||
target_link_libraries(key_app_writer mbedtls)
|
||||
|
||||
add_executable(mpi_demo mpi_demo.c)
|
||||
target_link_libraries(mpi_demo polarssl)
|
||||
target_link_libraries(mpi_demo mbedtls)
|
||||
|
||||
add_executable(rsa_genkey rsa_genkey.c)
|
||||
target_link_libraries(rsa_genkey polarssl)
|
||||
target_link_libraries(rsa_genkey mbedtls)
|
||||
|
||||
add_executable(rsa_sign rsa_sign.c)
|
||||
target_link_libraries(rsa_sign polarssl)
|
||||
target_link_libraries(rsa_sign mbedtls)
|
||||
|
||||
add_executable(rsa_verify rsa_verify.c)
|
||||
target_link_libraries(rsa_verify polarssl)
|
||||
target_link_libraries(rsa_verify mbedtls)
|
||||
|
||||
add_executable(rsa_sign_pss rsa_sign_pss.c)
|
||||
target_link_libraries(rsa_sign_pss polarssl)
|
||||
target_link_libraries(rsa_sign_pss mbedtls)
|
||||
|
||||
add_executable(rsa_verify_pss rsa_verify_pss.c)
|
||||
target_link_libraries(rsa_verify_pss polarssl)
|
||||
target_link_libraries(rsa_verify_pss mbedtls)
|
||||
|
||||
add_executable(rsa_encrypt rsa_encrypt.c)
|
||||
target_link_libraries(rsa_encrypt polarssl)
|
||||
target_link_libraries(rsa_encrypt mbedtls)
|
||||
|
||||
add_executable(rsa_decrypt rsa_decrypt.c)
|
||||
target_link_libraries(rsa_decrypt polarssl)
|
||||
target_link_libraries(rsa_decrypt mbedtls)
|
||||
|
||||
add_executable(pk_sign pk_sign.c)
|
||||
target_link_libraries(pk_sign polarssl)
|
||||
target_link_libraries(pk_sign mbedtls)
|
||||
|
||||
add_executable(pk_verify pk_verify.c)
|
||||
target_link_libraries(pk_verify polarssl)
|
||||
target_link_libraries(pk_verify mbedtls)
|
||||
|
||||
add_executable(pk_encrypt pk_encrypt.c)
|
||||
target_link_libraries(pk_encrypt polarssl)
|
||||
target_link_libraries(pk_encrypt mbedtls)
|
||||
|
||||
add_executable(pk_decrypt pk_decrypt.c)
|
||||
target_link_libraries(pk_decrypt polarssl)
|
||||
target_link_libraries(pk_decrypt mbedtls)
|
||||
|
||||
install(TARGETS dh_client dh_genprime dh_server key_app mpi_demo rsa_genkey rsa_sign rsa_verify rsa_encrypt rsa_decrypt pk_encrypt pk_decrypt pk_sign pk_verify gen_key
|
||||
DESTINATION "bin"
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
add_executable(gen_random_havege gen_random_havege.c)
|
||||
target_link_libraries(gen_random_havege polarssl)
|
||||
target_link_libraries(gen_random_havege mbedtls)
|
||||
|
||||
add_executable(gen_random_ctr_drbg gen_random_ctr_drbg.c)
|
||||
target_link_libraries(gen_random_ctr_drbg polarssl)
|
||||
target_link_libraries(gen_random_ctr_drbg mbedtls)
|
||||
|
||||
add_executable(gen_entropy gen_entropy.c)
|
||||
target_link_libraries(gen_entropy polarssl)
|
||||
target_link_libraries(gen_entropy mbedtls)
|
||||
|
||||
install(TARGETS gen_random_havege gen_random_ctr_drbg gen_entropy
|
||||
DESTINATION "bin"
|
||||
|
|
|
@ -2,7 +2,7 @@ set(THREADS_USE_PTHREADS_WIN32 true)
|
|||
find_package(Threads)
|
||||
|
||||
set(libs
|
||||
polarssl
|
||||
mbedtls
|
||||
)
|
||||
|
||||
set(targets
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
FIND_PACKAGE(OpenSSL)
|
||||
|
||||
set(libs
|
||||
polarssl
|
||||
mbedtls
|
||||
)
|
||||
|
||||
if(USE_PKCS11_HELPER_LIBRARY)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
set(libs
|
||||
polarssl
|
||||
mbedtls
|
||||
)
|
||||
|
||||
add_executable(strerror strerror.c)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
set(libs
|
||||
polarssl
|
||||
mbedtls
|
||||
)
|
||||
|
||||
if(USE_PKCS11_HELPER_LIBRARY)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
set(libs
|
||||
polarssl
|
||||
mbedtls
|
||||
)
|
||||
|
||||
if(USE_PKCS11_HELPER_LIBRARY)
|
||||
|
@ -20,7 +20,7 @@ function(add_test_suite suite_name)
|
|||
add_custom_command(
|
||||
OUTPUT test_suite_${data_name}.c
|
||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/scripts/generate_code.pl ${CMAKE_CURRENT_SOURCE_DIR}/suites test_suite_${suite_name} test_suite_${data_name}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/generate_code.pl polarssl suites/helpers.function suites/main_test.function suites/test_suite_${suite_name}.function suites/test_suite_${data_name}.data
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/generate_code.pl mbedtls suites/helpers.function suites/main_test.function suites/test_suite_${suite_name}.function suites/test_suite_${data_name}.data
|
||||
)
|
||||
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
|
Loading…
Reference in a new issue