2020-01-14 20:06:37 +00:00
|
|
|
project(darling-corecrypto)
|
2016-10-07 17:44:00 +00:00
|
|
|
|
2020-01-14 20:06:37 +00:00
|
|
|
add_compile_options(
|
|
|
|
-Wno-return-type
|
|
|
|
)
|
2017-05-03 02:55:29 +00:00
|
|
|
|
2017-04-26 04:54:04 +00:00
|
|
|
add_definitions(
|
2019-12-22 23:02:31 +00:00
|
|
|
-DDEBUG
|
2017-04-26 04:54:04 +00:00
|
|
|
-D_FILE_OFFSET_BITS=64
|
2016-10-07 17:44:00 +00:00
|
|
|
)
|
|
|
|
|
2017-04-26 04:54:04 +00:00
|
|
|
include_directories(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/include
|
|
|
|
)
|
2016-10-07 17:44:00 +00:00
|
|
|
|
2020-01-14 19:14:12 +00:00
|
|
|
set(corecrypto_sources
|
2017-04-26 04:54:04 +00:00
|
|
|
src/cc.c
|
|
|
|
src/ccdigest.c
|
|
|
|
src/ccmd2.c
|
|
|
|
src/ccmd4.c
|
|
|
|
src/ccmd5.c
|
|
|
|
src/ccder.c
|
2017-05-03 02:55:29 +00:00
|
|
|
src/ccec.c
|
|
|
|
src/ccdh.c
|
|
|
|
src/ccdh_gp.c
|
|
|
|
src/ccaes.c
|
2017-08-08 14:45:08 +00:00
|
|
|
src/ccsha2xx.c
|
|
|
|
src/ccsha3xx.c
|
2017-05-03 02:55:29 +00:00
|
|
|
src/cczp.c
|
|
|
|
src/ccsha1.c
|
|
|
|
src/ccrsa.c
|
|
|
|
src/ccrng.c
|
2017-08-08 11:34:45 +00:00
|
|
|
src/ccrng_system.c
|
2017-05-03 02:55:29 +00:00
|
|
|
src/ccrc4.c
|
|
|
|
src/ccn.c
|
|
|
|
src/ccmode.c
|
|
|
|
src/ccdes.c
|
2017-05-06 17:53:05 +00:00
|
|
|
src/ccrsa_priv.c
|
2017-05-08 01:01:44 +00:00
|
|
|
src/cccast.c
|
|
|
|
src/ccrc2.c
|
|
|
|
src/ccblowfish.c
|
|
|
|
src/ccnistkdf.c
|
|
|
|
src/ccz.c
|
|
|
|
src/cccmac.c
|
|
|
|
src/ccripemd.c
|
|
|
|
src/cchkdf.c
|
|
|
|
src/cchmac.c
|
|
|
|
src/ccpad.c
|
|
|
|
src/ccpbkdf2.c
|
|
|
|
src/ccrc4.c
|
2017-06-13 20:45:28 +00:00
|
|
|
src/ccansikdf.c
|
|
|
|
src/ccecies.c
|
2017-08-08 15:01:58 +00:00
|
|
|
src/ccrng_pbkdf2.c
|
2020-03-29 16:36:57 +00:00
|
|
|
src/ccec_projective_point.c
|
|
|
|
src/ccec_points.c
|
|
|
|
src/ccn_extra.c
|
|
|
|
src/cczp_extra.c
|
2020-04-05 16:39:46 +00:00
|
|
|
src/ccgcm.c
|
2022-10-03 04:58:27 +00:00
|
|
|
src/cch2c.c
|
2020-04-01 04:01:50 +00:00
|
|
|
src/ccsrp.c
|
2020-06-23 21:36:30 +00:00
|
|
|
src/ccwrap_priv.c
|
2020-06-24 00:38:46 +00:00
|
|
|
src/cc_priv.c
|
2020-07-23 17:53:29 +00:00
|
|
|
src/ccec25519.c
|
2021-01-10 20:22:00 +00:00
|
|
|
src/cccbc.c
|
|
|
|
src/ccccm.c
|
|
|
|
src/cccfb.c
|
|
|
|
src/cccfb8.c
|
2022-10-03 04:58:27 +00:00
|
|
|
src/ccchacha20poly1305.c
|
2021-01-10 20:22:00 +00:00
|
|
|
src/ccctr.c
|
|
|
|
src/ccofb.c
|
|
|
|
src/ccxts.c
|
|
|
|
src/ccckg.c
|
2017-04-26 04:54:04 +00:00
|
|
|
)
|
2016-10-07 17:44:00 +00:00
|
|
|
|
2021-01-10 16:59:20 +00:00
|
|
|
if (DARLING)
|
|
|
|
add_compile_options(
|
|
|
|
-nostdinc
|
|
|
|
)
|
|
|
|
|
|
|
|
set(DYLIB_INSTALL_NAME "/usr/lib/system/libcorecrypto.dylib")
|
|
|
|
add_circular(corecrypto FAT
|
|
|
|
SOURCES
|
|
|
|
${corecrypto_sources}
|
|
|
|
SIBLINGS
|
|
|
|
system_dyld
|
|
|
|
compiler_rt
|
|
|
|
system_kernel
|
|
|
|
platform
|
|
|
|
system_malloc
|
|
|
|
system_c
|
|
|
|
system_blocks
|
|
|
|
system_pthread
|
|
|
|
macho
|
|
|
|
libdispatch_shared
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_options(corecrypto PRIVATE
|
|
|
|
-Wl,-exported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/scripts/exported-symbols.exp
|
|
|
|
)
|
2020-01-14 20:06:37 +00:00
|
|
|
|
2021-01-10 16:59:20 +00:00
|
|
|
add_darling_static_library(corecrypto_static FAT SOURCES $<TARGET_OBJECTS:corecrypto_obj>)
|
2020-07-02 15:51:21 +00:00
|
|
|
|
2021-01-10 16:59:20 +00:00
|
|
|
install(TARGETS corecrypto DESTINATION libexec/darling/usr/lib/system)
|
|
|
|
else()
|
|
|
|
add_library(corecrypto SHARED ${corecrypto_sources})
|
|
|
|
# TODO: define list of exported symbols for non-Apple linkers
|
|
|
|
# maybe we should just define CC_EXPORT and sprinkle that throughout our codebase
|
|
|
|
#
|
|
|
|
# building for non-Apple platforms is only used for quick testing at the moment,
|
|
|
|
# so it doesn't matter that much if we have some unwanted exported symbols
|
|
|
|
endif()
|
2020-01-14 19:14:12 +00:00
|
|
|
|
2020-01-14 20:06:37 +00:00
|
|
|
if (ENABLE_TESTS)
|
2020-01-14 19:14:12 +00:00
|
|
|
add_subdirectory(tests)
|
2020-01-14 20:06:37 +00:00
|
|
|
endif (ENABLE_TESTS)
|