cmake_minimum_required(VERSION 3.28)


###############################################################################
# Options

option(WHLJS_BUILD_DOCS_GENERATOR "Build documentation generator" OFF)


###############################################################################
# Dependencies

find_package(whalejs-common CONFIG)
find_package(whale-core CONFIG)


###############################################################################
# whalejs-core

whljs_project(core VERSION 0.4.0)

whljs_module(core)

whljs_module_sources(core
  PRIVATE
    "include/whalejs/core/buffer.h"
    "include/whalejs/core/event.h"
    "include/whalejs/core/export.h"
    "include/whalejs/core/window.h"
    "include/whalejs/core/fs/android_asset_file_system.h"
    "include/whalejs/core/fs/directory.h"
    "include/whalejs/core/fs/file.h"
    "include/whalejs/core/fs/local_file_system.h"
    "include/whalejs/core/gfx/canvas.h"
    "include/whalejs/core/gfx/buffer_object.h"
    "include/whalejs/core/gfx/frame_buffer.h"
    "include/whalejs/core/gfx/image.h"
    "include/whalejs/core/gfx/program.h"
    "include/whalejs/core/gfx/render_context.h"
    "include/whalejs/core/gfx/shader.h"
    "include/whalejs/core/gfx/sprite_sheet.h"
    "include/whalejs/core/gfx/texture.h"
    "include/whalejs/core/gfx/uniform.h"
    "include/whalejs/core/gfx/uniform_set.h"
    "include/whalejs/core/gfx/vertex_attr.h"
    "include/whalejs/core/gfx/vertex_attr_list.h"
    "include/whalejs/core/math/mat.h"
    "include/whalejs/core/math/rect.h"
    "include/whalejs/core/math/vec.h"

    "src/export.cpp"
)

whljs_link_whale_libraries(core
  core
)

whljs_compile_definitions(core
  PRIVATE
    WHLJS_CORE_BUILD
)

whljs_module_install(core)
