include_directories(. ../include) if (UNIX) set(PERLASM_STYLE elf) set(ASM_EXT S) enable_language(ASM) else() if (CMAKE_CL_64) message("Using masm") set(PERLASM_STYLE masm) else() message("Using win32n") set(PERLASM_STYLE win32n) endif() set(ASM_EXT asm) enable_language(ASM_MASM) endif() function(perlasm dest src) add_custom_command( OUTPUT ${dest} COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/${src} ${PERLASM_STYLE} ${ARGN} > ${dest} DEPENDS ${src} ${PROJECT_SOURCE_DIR}/crypto/perlasm/x86_64-xlate.pl ${PROJECT_SOURCE_DIR}/crypto/perlasm/x86gas.pl ${PROJECT_SOURCE_DIR}/crypto/perlasm/x86asm.pl ${PROJECT_SOURCE_DIR}/crypto/perlasm/x86asm.pl WORKING_DIRECTORY . ) endfunction() if (${ARCH} STREQUAL "x86_64") set( CRYPTO_ARCH_SOURCES cpu-x86_64-asm.${ASM_EXT} cpu-intel.c ) endif() if (${ARCH} STREQUAL "x86") set( CRYPTO_ARCH_SOURCES cpu-x86-asm.${ASM_EXT} cpu-intel.c ) endif() if (${ARCH} STREQUAL "arm") set( CRYPTO_ARCH_SOURCES cpu-x86-asm.${ASM_EXT} cpu-arm.c ) endif() # Level 0.1 - depends on nothing outside this set. add_subdirectory(stack) add_subdirectory(lhash) add_subdirectory(err) add_subdirectory(buf) add_subdirectory(base64) add_subdirectory(bytestring) # Level 0.2 - depends on nothing but itself add_subdirectory(sha) add_subdirectory(md5) add_subdirectory(modes) add_subdirectory(aes) add_subdirectory(des) add_subdirectory(rc4) add_subdirectory(conf) add_subdirectory(chacha) add_subdirectory(poly1305) # Level 1, depends only on 0.* add_subdirectory(digest) add_subdirectory(cipher) add_subdirectory(rand) add_subdirectory(bio) add_subdirectory(bn) add_subdirectory(obj) add_subdirectory(asn1) # Level 2 add_subdirectory(engine) add_subdirectory(dh) add_subdirectory(dsa) add_subdirectory(rsa) add_subdirectory(ec) add_subdirectory(ecdh) add_subdirectory(ecdsa) add_subdirectory(hmac) # Level 3 add_subdirectory(evp) add_subdirectory(pem) add_subdirectory(x509) add_subdirectory(x509v3) # Level 4 add_subdirectory(pkcs8) add_library( crypto STATIC crypto_error.c mem.c mem_clear.c thread.c ex_data.c ex_data_impl.c time_support.c directory_posix.c directory_win.c ${CRYPTO_ARCH_SOURCES} $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ ) perlasm(cpu-x86_64-asm.${ASM_EXT} cpu-x86_64-asm.pl) perlasm(cpu-x86-asm.${ASM_EXT} cpu-x86-asm.pl)