# SPDX-License-Identifier: MIT
find_package(SDL2 2.0.18 REQUIRED CONFIG)

set(bfm_root "${CMAKE_CURRENT_SOURCE_DIR}/..")
add_executable(musashi_native_boot
    player.c
    gameplay_run.c
    chapter_completion.c
    chapter_restart.c
    desktop_voice.c
    palace_effects.c
    palace_score.c
    spu_envelope.c
    sqv_track.c
    palace_sound_bank.c
    palace_rise.c
    palace_flash.c
    spu_sample.c
    palace_voice.c
    inn_field.c
    inn_keeper.c
    inn_greeting.c
    inn_menu.c
    inn_profile.c
    inn_card.c
    "${bfm_root}/pc_port/card/card_host_storage.c"
    "${bfm_root}/pc_port/platform/bfm_plat_storage.c"
    save_menu.c
    save_view.c
    bedroom.c
    library_books.c
    cable_sound.c
    cable_sparks.c
    castle_cable.c
    village_arrival.c
    village_arrival_motion.c
    village_camera.c
    village_clock.c
    field_rest.c
    village_talk_camera.c
    village_cable.c
    village_rotor.c
    village_rotor_mesh.c
    forest_maze.c
    forest_maze_actors.c
    forest_maze_dog.c
    forest_maze_drift.c
    forest_maze_gate.c
    forest_maze_motion.c
    forest_maze_view.c
    forest_maze_wipe.c
    forest_bank.c
    forest_maze_guide_start.c
    forest_bank_hop.c
    forest_bank_hop_pose.c
    forest_bank_hop_ring.c
    forest_bank_thorns.c
    forest_bank_thorn_hurt.c
    forest_bank_fusion.c
    forest_bank_hopper.c
    southern_woods.c
    woods_box_return.c
    hells_valley.c
    valley_defeat.c
    valley_gate_door.c
    valley_gate_people.c
    valley_gate_team.c
    valley_bincho.c
    valley_knitter.c
    hells_valley_boulders.c
    valley_debris_art.c
    valley_hinge_debris.c
    valley_hinge.c
    valley_rock_fall.c
    valley_rock_support.c
    valley_earth_cast.c
    valley_quake_art.c
    valley_rock_shake.c
    valley_scroll_menu.c
    hells_valley_view.c
    woods_box_visit.c
    woods_earth_shrine.c
    woods_twinpeak_player_blade.c
    woods_twinpeak_stride.c
    woods_earth_shrine_view.c
    woods_earth_shrine_visit.c
    woods_earth_shrine_field.c
    woods_earth_shrine_hit.c
    woods_earth_shrine_release.c
    woods_earth_shrine_player.c
    woods_earth_shrine_scene_art.c
    woods_earth_shrine_presentation.c
    woods_earth_shrine_burst.c
    woods_earth_shrine_fragments.c
    woods_earth_shrine_tiles.c
    woods_earth_scroll_touch.c
    woods_earth_player_award.c
    woods_earth_award_effect.c
    woods_rootrick_actor.c
    woods_rootrick_art.c
    woods_rootrick_blocking.c
    woods_rootrick_challenge.c
    woods_rootrick_encounter.c
    woods_rootrick_hero.c
    woods_rootrick_impact.c
    woods_rootrick_ledge_art.c
    woods_rootrick_obstacles.c
    woods_rootrick_wall.c
    woods_rootrick_wall_effects.c
    woods_rootrick_boulder.c
    woods_rootrick_finale_actor.c
    woods_rootrick_finale_player.c
    woods_rootrick_summit.c
    woods_rootrick_notice.c
    woods_rootrick_race.c
    woods_rootrick_stage.c
    woods_rootrick_trigger.c
    woods_box_view.c
    woods_box_water.c
    woods_3026_box_hit.c
    woods_3026_box_art.c
    woods_pole_climb.c
    woods_pole_pickup.c
    woods_pole_pickup_art.c
    woods_pole_pose.c
    woods_pole_view.c
    woods_water.c
    woods_water_effect.c
    woods_sign_model.c
    woods_lardwick_field.c
    woods_lardwick_art.c
    woods_lardwick_award.c
    woods_lardwick_motes.c
    woods_lardwick_player.c
    woods_resident_glow_art.c
    woods_award_effect.c
    woods_blade_sparks.c
    woods_capture_light.c
    woods_flight_glow.c
    woods_caster.c
    woods_caster_ring.c
    woods_caster_loot.c
    woods_caster_melee.c
    woods_charged_targets.c
    woods_charged_hit.c
    woods_charged_fx.c
    woods_caster_burst.c
    woods_player_hit.c
    woods_revive.c
    woods_slope.c
    woods_mini_smoke.c
    woods_satiate_effect.c
    woods_satiate_actor.c
    woods_leno_actor.c
    woods_leno.c
    woods_carry.c
    village_leno_delivery.c
    village_earth_return.c
    village_earth_return_cast.c
    village_earth_portrait.c
    woods_king.c
    woods_king_art.c
    woods_king_reward.c
    woods_body_notice.c
    woods_lily.c
    woods_lily_art.c
    woods_jump_pose.c
    woods_fusion.c
    woods_fusion_art.c
    woods_foot_dust.c
    woods_charge_core.c
    woods_shrink_message.c
    woods_shrink_cast.c
    woods_shrink_motion.c
    woods_shrink_shot.c
    woods_shrink_light.c
    woods_shrink_ribbon.c
    village_field.c
    village_field_defeat.c
    village_gate.c
    village_upper_guard.c
    village_upper_landmarks.c
    village_greeting.c
    village_impact.c
    village_impact_sound.c
    village_portrait.c
    village_lower.c
    village_illness_lower.c
    village_illness_grocery.c
    village_illness_grocery_cast.c
    village_illness_wid.c
    village_illness_mine_gate.c
    village_mine_entrance.c
    village_switchback_props.c
    village_mine_corridor_387.c
    village_mine_view.c
    village_mine_props.c
    village_illness_mine_hero.c
    village_illness_windmill.c
    field_forced_bag.c
    field_inventory_actions.c
    field_item_menu_art.c
    bakery_door.c
    bakery_field.c
    bakery_room_art.c
    bakery_speech.c
    bakery_purchase.c
    bakery_service.c
    bakery_menu_art.c
    village_chimney.c
    village_sunrays.c
    village_jon_actor.c
    village_well.c
    village_jon_stage.c
    village_jon_dialogue.c
    village_jon_portrait.c
    village_stocks_prop.c
    village_lighting.c
    village_ground.c
    village_mayor_camera.c
    village_mayor_door.c
    village_mayor_cast.c
    village_mayor.c
    village_mayor_stage.c
    village_residents.c
    village_street_scenery.c
    village_sky.c
    bedroom_score.c
    bedroom_award.c
    bedroom_effects.c
    bedroom_dust.c
    bedroom_fade.c
    bedroom_figure.c
    bedroom_motion.c
    bedroom_reaction.c
    bedroom_record.c
    bedroom_script.c
    bedroom_travel.c
    bedroom_visitors.c
    "${bfm_root}/pc_port/card/card_image.c"
    title_flow.c
    title_view.c
    opening_view.c
    chapter_card.c
    palace.c
    stair_actors.c
    ritual_light.c
    ritual_rings.c
    hero_smoke_material.c
    hero_smoke.c
    palace_dialogue.c
    scene_tiles.c
    forest_bullet_art.c
    forest_blade.c
    forest_entry.c
    forest_drift.c
    forest_rifles.c
    forest_rifle_round.c
    forest_rifle_contact.c
    forest_hurt.c
    forest_muzzle_fan.c
    forest_glow_figures.c
    forest_glows.c
    forest_glow_halo.c
    forest_dust.c
    forest_water_effect.c
    forest_fall.c
    forest_fall_projection.c
    forest_bridge_floor.c
    forest_upper_trunks.c
    forest_bridge.c
    forest_bridge_targets.c
    tower_camera.c
    tower_field.c
    tower_interior.c
    tower_interior_bell.c
    tower_bell_sound.c
    tower_bell_impact.c
    tower_bell_effect.c
    tower_interior_fixtures.c
    tower_ascent_door.c
    tower_interior_note.c
    tower_summit.c
    tower_summit_departure.c
    tower_summit_transfer.c
    tower_summit_arrival.c
    tower_summit_camera.c
    tower_summit_figures.c
    tower_summit_pressure.c
    tower_summit_residents.c
    tower_escape.c
    tower_escape_camera.c
    tower_escape_head.c
    tower_escape_props.c
    tower_summit_pickup.c
    tower_summit_stun.c
    tower_stun_cast.c
    tower_summit_lesson.c
    tower_figures.c
    tower_door_lights.c
    tower_pylons.c
    tower_press_effect.c
    tower_lightning.c
    tower_note.c
    tower_note_pose.c
    tower_sky.c
    forest_field.c
    forest_fusion_power.c
    forest_hud.c
    forest_status.c
    forest_absorption.c
    forest_lesson.c
    forest_lesson_fusion.c
    forest_cast.c
    forest_award.c
    forest_gunshot.c
    forest_bridge_retreat.c
    forest_bullet.c
    forest_flight.c
    forest_fusion_model.c
    forest_tether_trails.c
    forest_lesson_camera.c
    forest_lesson_guard.c
    forest_lesson_pages.c
    forest_manual.c
    forest_motion.c
    forest_marker.c
    forest_shore.c
    forest_guard_clip.c
    forest_guard_contact.c
    forest_trail.c
    forest_boulders.c
    forest_barrier_art.c
    forest_shore_motion.c
    forest_shore_behavior.c
    forest_shore_response.c
    forest_shore_throw.c
    forest_shore_figures.c
    forest_shore_pose.c
    forest_pose.c
    forest_raster.c
    forest_muzzle_art.c
    forest_shot_effects.c
    forest_shot_impact.c
    forest_shot_spark.c
    forest_shot_flash.c
    forest_terrain.c
    forest_speech_actor.c
    disc_voice.c
    tower_disc_music.c
    forest_score.c
    forest_voice.c
    dialogue_contour.c
    forest_message_art.c
    forest_message.c
    castle_drawbridge.c
    castle_drawbridge_view.c
    castle_audience.c
    castle_audience_dialogue.c
    castle_audience_stage.c
    castle_audience_visitors.c
    steam_knight.c
    steam_knight_event.c
    steam_knight_finale.c
    steam_knight_effects.c
    steam_knight_charge_effect.c
    steam_knight_entry_light.c
    steam_knight_cast.c
    steam_knight_machine.c
    steam_knight_street_route.c
    steam_knight_flail.c
    steam_knight_spin_contact.c
    steam_knight_armor.c
    steam_knight_core_contact.c
    steam_knight_core_damage.c
    steam_knight_core_origin.c
    steam_knight_carry.c
    steam_knight_grip.c
    steam_knight_throw.c
    steam_knight_hero_motion.c
    steam_knight_corner.c
    steam_knight_boss_hud.c
    steam_knight_rotation.c
    steam_knight_flames.c
    steam_knight_field.c
    steam_knight_roof_cells.c
    retry_screen.c
    woods_retry.c
    nightmare_departure.c
    nightmare_field.c
    nightmare_room.c
    nightmare_transition.c
    nightmare_stride.c
    nightmare_wake.c
    forest_walk.c
    forest_gateway_transition.c
    forest_lift.c
    forest_swing.c
    forest_impact.c
    forest_damage_digits.c
    forest_sweep.c
    forest_sparks.c
    forest_strike_effects.c
    scene_payload.c
    "${bfm_root}/pc_port/forest_player_archive.c"
    "${bfm_root}/pc_port/forest_player_mesh.c"
    "${bfm_root}/src/overlays/sc01_0077/8012a018.c"
    "${bfm_root}/src/overlays/sc01_0077/8012a048.c"
    "${bfm_root}/src/overlays/sc01_0077/80134510.c"
    "${bfm_root}/src/overlays/sc01_0077/801345f8.c"
    "${bfm_root}/src/overlays/sc01_0077/801347a0.c"
    "${bfm_root}/src/overlays/sc01_0077/80134a28.c"
    "${bfm_root}/src/overlays/sc01_0077/801473ec.c"
    "${bfm_root}/src/overlays/sc01_0077/80174e9c.c"
    "${bfm_root}/src/overlays/sc01_0077/8017d900.c"
    "${bfm_root}/src/overlays/sc01_0077/8017d98c.c"
    "${bfm_root}/src/overlays/main_0003/800cf104.c"
    "${bfm_root}/pc_port/disc_media.c"
    "${bfm_root}/pc_port/platform/bfm_plat_sha256.c"
    "${bfm_root}/pc_port/platform/bfm_plat_font.c")
target_compile_features(musashi_native_boot PRIVATE c_std_99)
target_include_directories(musashi_native_boot PRIVATE
    "${bfm_root}/pc_port/card"
    "${bfm_root}/pc_port/include"
    "${bfm_root}/pc_port/platform"
    "${bfm_root}/include")
target_link_libraries(musashi_native_boot PRIVATE SDL2::SDL2)
target_compile_definitions(musashi_native_boot PRIVATE MUSASHI_STANDALONE_SHA256=1 BFM_MEMCARD_ONLY=1)

if(NOT MSVC)
    target_link_libraries(musashi_native_boot PRIVATE m)
endif()
