cmake_minimum_required(VERSION 3.2)
project(Libparc)
+option(DISABLE_EXECUTABLES "Disable executables" OFF)
+option(DISABLE_SHARED_LIBRARIES "Disable shared libraries" OFF)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
if (DOC_ONLY)
message("############ Skipping check of required dependencies.")
-elseif(COMPILE_FOR_IOS)
- find_host_package( LibEvent REQUIRED )
- include_directories(${LIBEVENT_INCLUDE_DIRS})
- find_package ( Threads REQUIRED )
- find_host_package ( OpenSSL REQUIRED )
else()
find_package( LibEvent REQUIRED )
include_directories(${LIBEVENT_INCLUDE_DIRS})
)
endif()
-if(WIN32)\r
- list(APPEND LIBPARC_SOURCE_FILES\r
- ${WINDOWS_UTILITY_SOURCE_FILES}\r
- ${WINDOWS_UTILITY_HEADER_FILES}\r
- )\r
+if(WIN32)
+ list(APPEND LIBPARC_SOURCE_FILES
+ ${WINDOWS_UTILITY_SOURCE_FILES}
+ ${WINDOWS_UTILITY_HEADER_FILES}
+ )
endif()
set(LIBPARC_ALGOL_FILES ${LIBPARC_ALGOL_SOURCE_FILES} ${LIBPARC_ALGOL_HEADER_FILES})
set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS} -undefined dynamic_lookup")
message( "-- Set \"-undefined dynamic_lookup\" for shared libraries")
endif()
-if(COMPILE_FOR_IOS OR ${CMAKE_SYSTEM_NAME} STREQUAL "Android")
+if(DISABLE_SHARED_LIBRARIES)
add_library(parc STATIC ${LIBPARC_SOURCE_FILES} ${LIBEVENT_LIBRARIES} ${OPENSSL_LIBRARIES})
target_link_libraries(parc ${LIBEVENT_LIBRARIES})
target_link_libraries(parc ${OPENSSL_LIBRARIES})
parc
parc.shared
)
-
endif()
endif()
if(ENABLE_TEST)
- if(NOT COMPILE_FOR_IOS)
add_subdirectory(security/command-line)
add_subdirectory(algol/test)
add_subdirectory(concurrent/test)
add_subdirectory(testing/test)
add_subdirectory(statistics/test)
add_subdirectory(memory/test)
- endif()
else()
- if(NOT COMPILE_FOR_IOS)
add_subdirectory(security/command-line)
- endif()
endif()
set(PARC_PUBLICKEY_SRC
parc-publickey.c
parcPublicKey_About.c
- )
+)
-add_executable(parc-publickey ${PARC_PUBLICKEY_SRC})
-target_link_libraries(parc-publickey ${PARC_BIN_LIBRARIES})
-install( TARGETS parc-publickey COMPONENT library RUNTIME DESTINATION bin )
+if (NOT DISABLE_EXECUTABLES)
+ add_executable(parc-publickey ${PARC_PUBLICKEY_SRC})
+ target_link_libraries(parc-publickey ${PARC_BIN_LIBRARIES})
+ install( TARGETS parc-publickey COMPONENT library RUNTIME DESTINATION bin )
+endif ()
\ No newline at end of file
#include <openssl/pem.h>
#include <openssl/rand.h>
+#include <openssl/bn.h>
struct parc_diffie_hellman_keyshare {
PARCDiffieHellmanGroup groupType;
#include <openssl/x509v3.h>
#include <openssl/ecdsa.h>
+#include <openssl/rsa.h>
struct parc_inmemory_verifier {
#include <openssl/pkcs12.h>
#include <openssl/x509v3.h>
#include <openssl/err.h>
-
+#include <openssl/rsa.h>
struct PARCPublicKeySigner {
PARCKeyStore *keyStore;
PARCSigningAlgorithm signingAlgorithm;
#include <openssl/x509v3.h>
#include <openssl/rand.h>
#include <openssl/pkcs12.h>
+#include <openssl/x509.h>
static PARCCryptoHash *_getPublicKeyDigest(void *interfaceContext);
static PARCCryptoHash *_getCertificateDigest(void *interfaceContext);