file(GLOB SOURCE *.c)
add_executable(otvdm ${SOURCE})
include_directories(../wine)
add_definitions(-D_X86_)
target_link_libraries(otvdm libwine krnl386)
set(DELAYED_LOADS "/DELAYLOAD:krnl386.exe16 /DELAYLOAD:libwine.dll /DELAYLOAD:user32.dll /DELAYLOAD:kernel32.dll /DELAYLOAD:gdi32.dll /DELAYLOAD:shell32.dll /DELAYLOAD:comdlg32.dll /DELAYLOAD:ADVAPI32.dll")
target_compile_definitions(otvdm PRIVATE -D_CONSOLE)
if (MSVC)
    set_target_properties(otvdm PROPERTIES LINK_FLAGS ${DELAYED_LOADS})
endif()
add_executable(otvdmw WIN32 ${SOURCE})
target_link_libraries(otvdmw libwine krnl386)
if (MSVC)
    set_target_properties(otvdmw PROPERTIES LINK_FLAGS ${DELAYED_LOADS})
endif()
