-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
52 lines (43 loc) · 1.66 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.6)
project(Lava)
# To override the Debug build type, invoke cmake with -DCMAKE_BUILD_TYPE=Release
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Debug' as none was specified.")
set(CMAKE_BUILD_TYPE "Debug")
endif()
# Note that -fsanitize=undefined is also an interesting option.
# -fsanitize=leak is also interesting, but not yet supported on MacOS.
# set(EXTRA_SANITIZE_OPTIONS "-fsanitize=address")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${EXTRA_SANITIZE_OPTIONS}")
set(CMAKE_CXX_FLAGS "-std=c++14 -stdlib=libc++ -fno-rtti")
# If submodules have been initialized, then build demo dependencies.
if(EXISTS "${CMAKE_SOURCE_DIR}/extras/glfw/CMakeLists.txt")
add_subdirectory(extras/glfw)
add_subdirectory(extras/glslang)
add_subdirectory(extras/SimpleFileWatcher)
endif()
# Build the core library (zero dependencies).
include_directories(include)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
set(LAVA_SOURCE
src/LavaContext.cpp
src/LavaCpuBuffer.cpp
src/LavaDescCache.cpp
src/LavaGpuBuffer.cpp
src/LavaInternal.cpp
src/LavaLoader.cpp
src/LavaLog.cpp
src/LavaSurfCache.cpp
src/LavaPipeCache.cpp
src/LavaTexture.cpp)
if(AMBER_REQUIRED)
set(AMBER_SOURCE
${CMAKE_CURRENT_SOURCE_DIR}/src/AmberMain.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/AmberCompiler.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/AmberProgram.cpp PARENT_SCOPE)
endif()
add_library(lava STATIC ${LAVA_SOURCE})
# Build demos if submodules have been initialized.
if(EXISTS "${CMAKE_SOURCE_DIR}/extras/glfw/CMakeLists.txt")
add_subdirectory(demos)
endif()