cmake_minimum_required(VERSION 3.14)

project(ao-play-async LANGUAGES C)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_library(ao-play-async SHARED
    ao_playasync.c
    ao_playasync.h
)

if(WIN32)
    #include_directories(../../libao/include ../../libao/build-windows)
    include_directories(windows)
    target_link_directories(ao-play-async PRIVATE ../lib/windows-x86_64)
endif()

if(WIN32)
    target_link_libraries(ao-play-async PRIVATE libao-1.2.2 winmm.lib ksuser.lib)
else()
    target_link_libraries(ao-play-async PRIVATE ao)
endif()

target_compile_definitions(ao-play-async PRIVATE AOPLAYASYNC_LIBRARY)

