summaryrefslogtreecommitdiff
path: root/gfx/CMakeLists.txt
blob: e91450b0ae1a7320d08e1a95314b254971f1da42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
cmake_minimum_required(VERSION 3.0)

include(cmake/shader.txt)

add_subdirectory(contrib/cgltf)
add_subdirectory(contrib/cgltf-tangents)
add_subdirectory(contrib/glad)
add_subdirectory(contrib/stb)

project(gfx)

add_shader_library(shaders
  shaders/brdf_integration_map.frag
  shaders/cook_torrance.frag
  shaders/cook_torrance.vert
  shaders/cubemap_filtering.vert
  shaders/debug3d.frag
  shaders/debug3d.vert
  shaders/irradiance_map.frag
  shaders/prefiltered_environment_map.frag
  shaders/quad.vert
  shaders/skyquad.frag
  shaders/skyquad.vert
  shaders/view_normal_mapped_normals.frag
  shaders/view_normal_mapped_normals.vert
  shaders/view_normals.frag
  shaders/view_normals.vert
  shaders/view_tangents.frag
  shaders/view_tangents.vert
  shaders/view_texture.frag
  shaders/view_texture.vert)

add_library(gfx
  src/render/buffer.c
  src/render/framebuffer.c
  src/render/geometry.c
  src/render/render_backend.c
  src/render/renderbuffer.c
  src/render/shader_program.c
  src/render/shader.c
  src/render/texture.c
  src/renderer/renderer.c
  src/scene/camera.c
  src/scene/light.c
  src/scene/material.c
  src/scene/mesh.c
  src/scene/node.c
  src/scene/object.c
  src/scene/scene.c
  src/scene/scene_memory.c
  src/error.c
  src/gfx.c
  src/util/geometry.c
  src/util/ibl.c
  src/util/shader.c
  src/util/scene.c
  src/util/skyquad.c
  src/util/texture.c)

target_include_directories(gfx PUBLIC
  include)

target_include_directories(gfx PRIVATE
  src)

target_compile_options(gfx PRIVATE -std=gnu11 -Wall -Wextra -Wpedantic)

target_link_libraries(gfx PUBLIC
  cstring)

target_link_libraries(gfx PRIVATE
  cgltf
  cgltf-tangents
  glad
  listpool
  log
  math
  mempool
  shaders
  stb
  # System libraries.
  GL
  # Required to initialize GLAD.
  -ldl)