add_library(native_assets STATIC Resources.cpp Images.cpp GpuImage.cpp GpuImageRuntime.cpp GpuImageBc.cpp Meshes.cpp Animation.cpp LegacyModels.cpp World.cpp)
target_include_directories(native_assets PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_compile_features(native_assets PUBLIC cxx_std_20)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
    target_compile_options(native_assets PRIVATE -ffp-contract=off)
endif()

add_executable(asset_inspector ../../tools/asset-inspector/main.cpp)
target_link_libraries(asset_inspector PRIVATE native_assets)

add_executable(world_inspector ../../tools/world-inspector/main.cpp)
target_link_libraries(world_inspector PRIVATE native_assets)

if(BUILD_TESTING)
    add_executable(native_assets_test ../../tests/test_assets.cpp)
    target_link_libraries(native_assets_test PRIVATE native_assets)
    add_test(NAME native_assets_behavior COMMAND native_assets_test)
    add_executable(native_animation_test ../../tests/test_animation.cpp ../core/render_scene.cpp)
    target_link_libraries(native_animation_test PRIVATE native_assets native_materials c4_game_ui c4_settings)
    add_test(NAME native_animation_behavior COMMAND native_animation_test)
    add_executable(native_world_test ../../tests/test_world.cpp)
    target_link_libraries(native_world_test PRIVATE native_assets)
    add_test(NAME native_world_parser COMMAND native_world_test)
endif()
