# SPDX-License-Identifier: GPL-2.0-or-later
# SPDX-FileCopyrightText: Copyright (C) 2026 Max A. Vilkki a.k.a. codise
#
# flipsid-render: renders a tune to WAV offline through the player's sessions and measures
# its EBU R128 loudness (DESIGN §2.4: A/B listening). A developer tool: built by default
# so it keeps compiling, never installed or shipped.

# The command line, on its own so the tests can parse it.
add_library(flipsid_render_options STATIC render_options.cpp)
add_library(flipsid::render_options ALIAS flipsid_render_options)
target_include_directories(flipsid_render_options PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
target_link_libraries(flipsid_render_options PUBLIC flipsid::engines)
flipsid_configure_target(flipsid_render_options)

add_executable(flipsid_render main.cpp)
set_target_properties(flipsid_render PROPERTIES OUTPUT_NAME flipsid-render)
target_link_libraries(flipsid_render PRIVATE flipsid::render_options flipsid::player flipsid::engines
    ext::sidplayfp ext::ebur128)
flipsid_configure_target(flipsid_render)
# tools/common: the UTF-8 command line (Windows reads it from the wide one, with shell32).
target_include_directories(flipsid_render PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../common")
if(WIN32)
    target_link_libraries(flipsid_render PRIVATE shell32)
endif()
