2022-01-21 18:46:03 +00:00
|
|
|
set(SRC
|
|
|
|
decrypt.c
|
|
|
|
encrypt.c
|
|
|
|
romulus_m_reference.c
|
|
|
|
skinny_reference.c
|
|
|
|
)
|
|
|
|
|
2022-01-24 21:43:57 +00:00
|
|
|
if(EMSCRIPTEN)
|
|
|
|
# WASM requires an executable, so we use a dummy target that doesn't do anything
|
|
|
|
# and link our library into it.
|
|
|
|
add_library(romulus-m STATIC ${SRC})
|
|
|
|
add_executable(romulus-m-wasm "main.c")
|
|
|
|
target_link_libraries(romulus-m-wasm PRIVATE romulus-m)
|
|
|
|
target_link_options(romulus-m-wasm PRIVATE -s EXPORTED_FUNCTIONS=['_main', '_crypto_aead_encrypt', '_crypto_aead_decrypt'])
|
|
|
|
else()
|
|
|
|
add_library(romulus-m SHARED ${SRC})
|
|
|
|
install(TARGETS romulus-m)
|
|
|
|
endif()
|