add_library(
    OxEvent
        signal.cpp
)

if(NOT MSVC)
    target_compile_options(OxEvent PRIVATE -Wsign-conversion)
    target_compile_options(OxEvent PRIVATE -Wconversion)
endif()

if(NOT OX_BARE_METAL)
    set_property(
        TARGET
            OxEvent
        PROPERTY
            POSITION_INDEPENDENT_CODE ON
    )
endif()

target_compile_definitions(
    OxEvent PUBLIC
        $<$<BOOL:${OX_USE_STDLIB}>:OX_USE_STDLIB>
        $<$<BOOL:${OX_NODEBUG}>:OX_NODEBUG>
)

target_link_libraries(
    OxEvent PUBLIC
        OxStd
)

install(
    FILES
        event.hpp
        signal.hpp
    DESTINATION
        include/ox/event
)

install(TARGETS OxEvent
        LIBRARY DESTINATION lib
        ARCHIVE DESTINATION lib
)

if(OX_RUN_TESTS)
    add_subdirectory(test)
endif()
