# SPDX-License-Identifier: MIT

# This file was generated by
# scripts/copy_from_pqclean/copy_from_pqclean.py

if(OQS_ENABLE_SIG_dilithium_2)
    add_library(dilithium_2_clean OBJECT sig_dilithium_2.c pqclean_dilithium2_clean/ntt.c pqclean_dilithium2_clean/packing.c pqclean_dilithium2_clean/poly.c pqclean_dilithium2_clean/polyvec.c pqclean_dilithium2_clean/reduce.c pqclean_dilithium2_clean/rounding.c pqclean_dilithium2_clean/sign.c pqclean_dilithium2_clean/symmetric-shake.c)
    target_compile_options(dilithium_2_clean PUBLIC -DDILITHIUM_MODE=2 -DDILITHIUM_RANDOMIZED_SIGNING)
    target_include_directories(dilithium_2_clean PRIVATE ${CMAKE_CURRENT_LIST_DIR}/pqclean_dilithium2_clean)
    target_include_directories(dilithium_2_clean PRIVATE ${PROJECT_SOURCE_DIR}/src/common/pqclean_shims)
    target_compile_options(dilithium_2_clean PUBLIC -DDILITHIUM_MODE=2 -DDILITHIUM_RANDOMIZED_SIGNING)
    set(_DILITHIUM_OBJS ${_DILITHIUM_OBJS} $<TARGET_OBJECTS:dilithium_2_clean>)
endif()

if(OQS_ENABLE_SIG_dilithium_2_avx2)
    add_library(dilithium_2_avx2 OBJECT pqclean_dilithium2_avx2/consts.c pqclean_dilithium2_avx2/invntt.S pqclean_dilithium2_avx2/ntt.S pqclean_dilithium2_avx2/packing.c pqclean_dilithium2_avx2/pointwise.S pqclean_dilithium2_avx2/poly.c pqclean_dilithium2_avx2/polyvec.c pqclean_dilithium2_avx2/reduce.S pqclean_dilithium2_avx2/rejsample.c pqclean_dilithium2_avx2/rounding.c pqclean_dilithium2_avx2/sign.c pqclean_dilithium2_avx2/symmetric-shake.c)
    target_include_directories(dilithium_2_avx2 PRIVATE ${CMAKE_CURRENT_LIST_DIR}/pqclean_dilithium2_avx2)
    target_include_directories(dilithium_2_avx2 PRIVATE ${PROJECT_SOURCE_DIR}/src/common/pqclean_shims)
    target_compile_options(dilithium_2_avx2 PRIVATE -mavx2 -maes -mbmi -mpopcnt)
    target_compile_options(dilithium_2_avx2 PUBLIC -DDILITHIUM_MODE=2 -DDILITHIUM_RANDOMIZED_SIGNING)
    set(_DILITHIUM_OBJS ${_DILITHIUM_OBJS} $<TARGET_OBJECTS:dilithium_2_avx2>)
endif()

if(OQS_ENABLE_SIG_dilithium_3)
    add_library(dilithium_3_clean OBJECT sig_dilithium_3.c pqclean_dilithium3_clean/fips202.c pqclean_dilithium3_clean/ntt.c pqclean_dilithium3_clean/packing.c pqclean_dilithium3_clean/poly.c pqclean_dilithium3_clean/polyvec.c pqclean_dilithium3_clean/reduce.c pqclean_dilithium3_clean/rounding.c pqclean_dilithium3_clean/sign.c pqclean_dilithium3_clean/symmetric-shake.c)
    target_compile_options(dilithium_3_clean PUBLIC -DDILITHIUM_MODE=3 -DDILITHIUM_RANDOMIZED_SIGNING)
    target_include_directories(dilithium_3_clean PRIVATE ${CMAKE_CURRENT_LIST_DIR}/pqclean_dilithium3_clean)
    target_include_directories(dilithium_3_clean PRIVATE ${PROJECT_SOURCE_DIR}/src/common/pqclean_shims)
    target_compile_options(dilithium_3_clean PUBLIC -DDILITHIUM_MODE=3 -DDILITHIUM_RANDOMIZED_SIGNING)
    set(_DILITHIUM_OBJS ${_DILITHIUM_OBJS} $<TARGET_OBJECTS:dilithium_3_clean>)
endif()

if(OQS_ENABLE_SIG_dilithium_3_avx2)
    add_library(dilithium_3_avx2 OBJECT pqclean_dilithium3_avx2/consts.c pqclean_dilithium3_avx2/fips202x4.c pqclean_dilithium3_avx2/invntt.S pqclean_dilithium3_avx2/keccak4x/KeccakP-1600-times4-SIMD256.c pqclean_dilithium3_avx2/ntt.S pqclean_dilithium3_avx2/packing.c pqclean_dilithium3_avx2/pointwise.S pqclean_dilithium3_avx2/poly.c pqclean_dilithium3_avx2/polyvec.c pqclean_dilithium3_avx2/reduce.S pqclean_dilithium3_avx2/rejsample.c pqclean_dilithium3_avx2/rounding.c pqclean_dilithium3_avx2/sign.c pqclean_dilithium3_avx2/symmetric-shake.c)
    target_include_directories(dilithium_3_avx2 PRIVATE ${CMAKE_CURRENT_LIST_DIR}/pqclean_dilithium3_avx2)
    target_include_directories(dilithium_3_avx2 PRIVATE ${PROJECT_SOURCE_DIR}/src/common/pqclean_shims)
    target_compile_options(dilithium_3_avx2 PRIVATE -mavx2 -maes -mbmi -mpopcnt)
    target_compile_options(dilithium_3_avx2 PUBLIC -DDILITHIUM_MODE=3 -DDILITHIUM_RANDOMIZED_SIGNING)
    set(_DILITHIUM_OBJS ${_DILITHIUM_OBJS} $<TARGET_OBJECTS:dilithium_3_avx2>)
endif()

if(OQS_ENABLE_SIG_dilithium_4)
    add_library(dilithium_4_clean OBJECT sig_dilithium_4.c pqclean_dilithium4_clean/ntt.c pqclean_dilithium4_clean/packing.c pqclean_dilithium4_clean/poly.c pqclean_dilithium4_clean/polyvec.c pqclean_dilithium4_clean/reduce.c pqclean_dilithium4_clean/rounding.c pqclean_dilithium4_clean/sign.c pqclean_dilithium4_clean/symmetric-shake.c)
    target_compile_options(dilithium_4_clean PUBLIC -DDILITHIUM_MODE=4 -DDILITHIUM_RANDOMIZED_SIGNING)
    target_include_directories(dilithium_4_clean PRIVATE ${CMAKE_CURRENT_LIST_DIR}/pqclean_dilithium4_clean)
    target_include_directories(dilithium_4_clean PRIVATE ${PROJECT_SOURCE_DIR}/src/common/pqclean_shims)
    target_compile_options(dilithium_4_clean PUBLIC -DDILITHIUM_MODE=4 -DDILITHIUM_RANDOMIZED_SIGNING)
    set(_DILITHIUM_OBJS ${_DILITHIUM_OBJS} $<TARGET_OBJECTS:dilithium_4_clean>)
endif()

if(OQS_ENABLE_SIG_dilithium_4_avx2)
    add_library(dilithium_4_avx2 OBJECT pqclean_dilithium4_avx2/consts.c pqclean_dilithium4_avx2/invntt.S pqclean_dilithium4_avx2/ntt.S pqclean_dilithium4_avx2/packing.c pqclean_dilithium4_avx2/pointwise.S pqclean_dilithium4_avx2/poly.c pqclean_dilithium4_avx2/polyvec.c pqclean_dilithium4_avx2/reduce.S pqclean_dilithium4_avx2/rejsample.c pqclean_dilithium4_avx2/rounding.c pqclean_dilithium4_avx2/sign.c pqclean_dilithium4_avx2/symmetric-shake.c)
    target_include_directories(dilithium_4_avx2 PRIVATE ${CMAKE_CURRENT_LIST_DIR}/pqclean_dilithium4_avx2)
    target_include_directories(dilithium_4_avx2 PRIVATE ${PROJECT_SOURCE_DIR}/src/common/pqclean_shims)
    target_compile_options(dilithium_4_avx2 PRIVATE -mavx2 -mbmi -maes -mpopcnt)
    target_compile_options(dilithium_4_avx2 PUBLIC -DDILITHIUM_MODE=4 -DDILITHIUM_RANDOMIZED_SIGNING)
    set(_DILITHIUM_OBJS ${_DILITHIUM_OBJS} $<TARGET_OBJECTS:dilithium_4_avx2>)
endif()

set(DILITHIUM_OBJS ${_DILITHIUM_OBJS} PARENT_SCOPE)
