2022-02-21 21:53:57 -08:00
|
|
|
if (WIN32)
|
|
|
|
set(SDL_LIBC ON CACHE BOOL "Use the system C library" FORCE)
|
|
|
|
endif ()
|
2022-02-15 23:05:42 -08:00
|
|
|
add_subdirectory(../extern/SDL SDL2 EXCLUDE_FROM_ALL)
|
|
|
|
if (NOT MSVC)
|
2022-02-23 21:20:41 -08:00
|
|
|
target_compile_options(SDL2-static PRIVATE -Wno-implicit-fallthrough -Wno-shadow)
|
2022-02-15 23:05:42 -08:00
|
|
|
endif ()
|
|
|
|
|
2022-02-15 21:21:24 -08:00
|
|
|
add_subdirectory(../extern/dawn dawn EXCLUDE_FROM_ALL)
|
2022-02-18 21:33:56 -08:00
|
|
|
target_compile_definitions(dawn_native PRIVATE
|
|
|
|
DAWN_ENABLE_VULKAN_VALIDATION_LAYERS
|
|
|
|
DAWN_VK_DATA_DIR="vulkandata")
|
2022-02-15 21:21:24 -08:00
|
|
|
if (NOT MSVC)
|
|
|
|
target_compile_options(SPIRV-Tools-static PRIVATE -Wno-implicit-fallthrough)
|
|
|
|
target_compile_options(SPIRV-Tools-opt PRIVATE -Wno-implicit-fallthrough)
|
|
|
|
endif ()
|
|
|
|
|
2022-02-16 15:13:40 -08:00
|
|
|
add_library(aurora STATIC
|
|
|
|
lib/aurora.cpp
|
2022-02-18 21:33:56 -08:00
|
|
|
lib/gpu.cpp
|
2022-02-16 15:13:40 -08:00
|
|
|
lib/imgui.cpp
|
2022-02-19 06:36:03 -08:00
|
|
|
lib/input.cpp
|
2022-02-16 15:13:40 -08:00
|
|
|
lib/dawn/BackendBinding.cpp
|
2022-02-21 22:28:28 -08:00
|
|
|
lib/dawn/Hacks.cpp
|
2022-02-16 15:13:40 -08:00
|
|
|
lib/gfx/common.cpp
|
2022-02-17 16:38:31 -08:00
|
|
|
lib/gfx/texture.cpp
|
|
|
|
lib/gfx/movie_player/shader.cpp
|
2022-02-19 00:28:44 -08:00
|
|
|
lib/gfx/textured_quad/shader.cpp
|
2022-02-20 13:06:04 -08:00
|
|
|
lib/gfx/colored_quad/shader.cpp
|
2022-02-16 15:13:40 -08:00
|
|
|
)
|
2022-02-16 22:03:00 -08:00
|
|
|
target_compile_definitions(aurora PRIVATE IMGUI_USER_CONFIG="imconfig_user.h") # IMGUI_USE_WCHAR32
|
2022-02-15 21:21:24 -08:00
|
|
|
target_include_directories(aurora PUBLIC include ../Runtime)
|
|
|
|
target_include_directories(aurora PRIVATE ../imgui ../extern/imgui)
|
2022-02-21 22:28:28 -08:00
|
|
|
target_include_directories(aurora PRIVATE
|
|
|
|
../extern/dawn/src
|
|
|
|
../extern/dawn/third_party/abseil-cpp
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/dawn/gen/src) # for hacks :)
|
2022-02-17 16:38:31 -08:00
|
|
|
target_link_libraries(aurora PRIVATE dawn_native dawncpp webgpu_dawn zeus logvisor SDL2-static xxhash)
|
2022-02-16 15:13:40 -08:00
|
|
|
if (APPLE)
|
|
|
|
target_compile_definitions(aurora PRIVATE DAWN_ENABLE_BACKEND_METAL)
|
|
|
|
target_sources(aurora PRIVATE lib/dawn/MetalBinding.mm)
|
|
|
|
set_source_files_properties(lib/dawn/MetalBinding.mm PROPERTIES COMPILE_FLAGS -fobjc-arc)
|
2022-02-21 21:53:57 -08:00
|
|
|
elseif (WIN32)
|
|
|
|
target_compile_definitions(aurora PRIVATE
|
|
|
|
DAWN_ENABLE_BACKEND_D3D12
|
|
|
|
DAWN_ENABLE_BACKEND_VULKAN)
|
|
|
|
target_sources(aurora PRIVATE lib/dawn/D3D12Binding.cpp lib/dawn/VulkanBinding.cpp)
|
2022-02-16 15:13:40 -08:00
|
|
|
else ()
|
|
|
|
target_compile_definitions(aurora PRIVATE
|
|
|
|
DAWN_ENABLE_BACKEND_VULKAN
|
|
|
|
DAWN_ENABLE_BACKEND_OPENGL
|
|
|
|
DAWN_ENABLE_BACKEND_DESKTOP_GL)
|
|
|
|
target_sources(aurora PRIVATE lib/dawn/OpenGLBinding.cpp lib/dawn/VulkanBinding.cpp)
|
|
|
|
endif ()
|