romulus/Romulus-M/CMakeLists.txt

19 lines
584 B
CMake

set(SRC
decrypt.c
encrypt.c
romulus_m_reference.c
skinny_reference.c
)
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()