# some systems have no shared libraries support, so check it
if(NOT DEFINED TARGET_SUPPORTS_SHARED_LIBS OR TARGET_SUPPORTS_SHARED_LIBS)
    add_executable(SharedApp SharedApp/Main.cpp)
    target_link_libraries(SharedApp SharedLib plog)
    set_target_properties(SharedApp PROPERTIES FOLDER Samples/Shared)
    # set PLOG to PLOG_GLOBAL/PLOG_IMPORT to share instances across modules (and import on Windows)
    if(WIN32)
        target_compile_definitions(SharedApp PRIVATE PLOG_IMPORT)
    else()
        target_compile_definitions(SharedApp PRIVATE PLOG_GLOBAL)
    endif()

    add_library(SharedLib SHARED SharedLib/Main.cpp)
    target_link_libraries(SharedLib plog)
    set_target_properties(SharedLib PROPERTIES FOLDER Samples/Shared)
    # set PLOG to PLOG_GLOBAL/PLOG_EXPORT to share instances across modules (and export on Windows)
    if(WIN32)
        target_compile_definitions(SharedLib PRIVATE PLOG_EXPORT)
    else()
        target_compile_definitions(SharedLib PRIVATE PLOG_GLOBAL)
    endif()
endif()
