should prob put this on git sometime
This commit is contained in:
79
destrum/CMakeLists.txt
Normal file
79
destrum/CMakeLists.txt
Normal file
@@ -0,0 +1,79 @@
|
||||
add_subdirectory(third_party)
|
||||
|
||||
set(SRC_FILES
|
||||
"src/App.cpp"
|
||||
|
||||
"src/Graphics/GfxDevice.cpp"
|
||||
"src/Graphics/ImmediateExecuter.cpp"
|
||||
"src/Graphics/Swapchain.cpp"
|
||||
"src/Graphics/VImage.cpp"
|
||||
"src/Graphics/Init.cpp"
|
||||
"src/Graphics/Util.cpp"
|
||||
"src/graphics/Pipeline.cpp"
|
||||
|
||||
"src/FS/AssetFS.cpp"
|
||||
)
|
||||
|
||||
add_library(destrum ${SRC_FILES})
|
||||
|
||||
add_library(destrum::destrum ALIAS destrum)
|
||||
|
||||
set_target_properties(destrum PROPERTIES
|
||||
CXX_STANDARD 20
|
||||
CXX_EXTENSIONS OFF
|
||||
)
|
||||
|
||||
#target_add_extra_warnings(destrum)
|
||||
|
||||
target_include_directories(destrum PUBLIC "${CMAKE_CURRENT_LIST_DIR}/include")
|
||||
|
||||
target_link_libraries(destrum
|
||||
PUBLIC
|
||||
volk::volk_headers
|
||||
vk-bootstrap::vk-bootstrap
|
||||
GPUOpen::VulkanMemoryAllocator
|
||||
|
||||
glm::glm
|
||||
nlohmann_json::nlohmann_json
|
||||
spdlog::spdlog
|
||||
|
||||
PRIVATE
|
||||
stb::image
|
||||
freetype::freetype
|
||||
)
|
||||
|
||||
target_compile_definitions(destrum
|
||||
PUBLIC
|
||||
VK_NO_PROTOTYPES
|
||||
VMA_VULKAN_VERSION=1003000
|
||||
# VOLK_DEFAULT_VISIBILITY # FIXME: doesn't work for some reason
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
target_link_libraries(destrum
|
||||
PUBLIC SDL2::SDL2main SDL2::SDL2
|
||||
)
|
||||
else()
|
||||
target_link_libraries(destrum
|
||||
PUBLIC SDL2::SDL2main SDL2::SDL2-static
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_compile_definitions(destrum
|
||||
PUBLIC
|
||||
GLM_FORCE_CTOR_INIT
|
||||
GLM_FORCE_XYZW_ONLY
|
||||
GLM_FORCE_EXPLICIT_CTOR
|
||||
GLM_FORCE_DEPTH_ZERO_TO_ONE
|
||||
GLM_ENABLE_EXPERIMENTAL
|
||||
)
|
||||
|
||||
set(DESTRUM_SHADER_SRC "${CMAKE_CURRENT_LIST_DIR}/assets_src/shaders")
|
||||
set(DESTRUM_SHADER_OUT "${CMAKE_CURRENT_LIST_DIR}/assets_runtime/shaders")
|
||||
|
||||
include(../cmake/compile_shaders.cmake)
|
||||
|
||||
compile_glsl_to_spv(destrum "${DESTRUM_SHADER_SRC}" "${DESTRUM_SHADER_OUT}" DESTRUM_SPV)
|
||||
add_dependencies(destrum destrum_shaders)
|
||||
Reference in New Issue
Block a user