# SPDX-License-Identifier: LicenseRef-CSSL-1.0

add_library(noise_device noise_device.c)
target_link_libraries(noise_device PRIVATE log_headers SIMU)
target_include_directories(noise_device PUBLIC ./)
set(CHANNEL_PIPELINE_SOURCES channel_pipeline.c)
if (CUDA_ENABLE)
  list(APPEND CHANNEL_PIPELINE_SOURCES channel_pipeline_v2.cu)
endif()
add_library(channel_pipeline ${CHANNEL_PIPELINE_SOURCES})
target_link_libraries(channel_pipeline PUBLIC thread-pool noise_device)
if (CUDA_ENABLE)
  target_link_libraries(channel_pipeline PUBLIC CUDA::toolkit)
endif()

if(CUDA_ENABLE)
    add_library(oai_cuda_lib STATIC
        multipath_channel.cu
        phase_noise.cu
        channel_pipeline.cu
    )

    target_link_libraries(oai_cuda_lib PUBLIC CUDA::toolkit)

    target_include_directories(oai_cuda_lib PUBLIC
        ${CMAKE_CURRENT_SOURCE_DIR}
    )
    target_link_libraries(channel_pipeline PUBLIC oai_cuda_lib)
endif()
