# SPDX-License-Identifier: GPL-2.0-or-later
# SPDX-FileCopyrightText: Copyright (C) 2026 Max A. Vilkki a.k.a. codise
#
# platform: what the operating system has to be asked for by name. For now the power side
# (DESIGN §7.3, "Failures as built"): a notice before the computer sleeps and after it
# woke, and a hold against App Nap and idle sleep while SID hardware plays. macOS has an
# implementation (IOKit, and NSProcessInfo through the Objective-C runtime's C API);
# elsewhere both are stubs that do nothing. No UI and no SDL type is here.

add_library(flipsid_platform STATIC)
if(APPLE)
    target_sources(flipsid_platform PRIVATE power_macos.cpp)
    target_link_libraries(flipsid_platform PRIVATE
        "-framework IOKit" "-framework CoreFoundation" "-framework Foundation")
else()
    target_sources(flipsid_platform PRIVATE power_stub.cpp)
endif()
add_library(flipsid::platform ALIAS flipsid_platform)

target_include_directories(flipsid_platform PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")

flipsid_configure_target(flipsid_platform)
