Submodules
This commit is contained in:
parent
086d310cd7
commit
68bb04b513
11 changed files with 66 additions and 70 deletions
|
@ -8,18 +8,18 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
|
||||
set(MIRROR_DIR ${CMAKE_BINARY_DIR}/../Mirror/)
|
||||
set(ENGINE_DIR ${CMAKE_BINARY_DIR}/../Engine/)
|
||||
set(MIRROR_DIR ${CMAKE_BINARY_DIR}/../Mirror/)
|
||||
set(ENGINE_DIR ${CMAKE_BINARY_DIR}/../Engine/)
|
||||
set(DEPENDENCIES_DIR ${CMAKE_BINARY_DIR}/../Dependencies/)
|
||||
|
||||
if(NOT MSV)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error")
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
add_compile_definitions(LIGHT_PLATFORM_WINDOWS)
|
||||
add_compile_definitions(LIGHT_PLATFORM_WINDOWS)
|
||||
elseif(UNIX)
|
||||
add_compile_definitions(LIGHT_PLATFORM_LINUX)
|
||||
add_compile_definitions(LIGHT_PLATFORM_LINUX)
|
||||
endif()
|
||||
|
||||
# Projects
|
||||
|
@ -39,30 +39,33 @@ add_subdirectory(${DEPENDENCIES_DIR}shaderc/)
|
|||
|
||||
# Link
|
||||
target_link_libraries(
|
||||
imgui
|
||||
PUBLIC glad
|
||||
PUBLIC glfw)
|
||||
imgui
|
||||
PUBLIC glad
|
||||
PUBLIC glfw
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
Engine
|
||||
PRIVATE glad
|
||||
PRIVATE glfw
|
||||
PRIVATE spdlog
|
||||
PRIVATE imgui
|
||||
PRIVATE stb_image
|
||||
PRIVATE yaml-cpp
|
||||
PRIVATE shaderc)
|
||||
Engine
|
||||
PRIVATE glad
|
||||
PRIVATE glfw
|
||||
PRIVATE spdlog
|
||||
PRIVATE imgui
|
||||
PRIVATE stb_image
|
||||
PRIVATE yaml-cpp
|
||||
PRIVATE shaderc
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
Mirror
|
||||
PRIVATE Engine
|
||||
PRIVATE imgui)
|
||||
Mirror
|
||||
PRIVATE Engine
|
||||
PRIVATE imgui
|
||||
)
|
||||
|
||||
# Precompiled headers
|
||||
target_precompile_headers(Engine PUBLIC ${ENGINE_DIR}src/Engine/ltpch.hpp)
|
||||
|
||||
if(MSVC)
|
||||
set_property(DIRECTORY ${CMAE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT Mirror)
|
||||
set_property(DIRECTORY ${CMAE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT Mirror)
|
||||
endif()
|
||||
|
||||
|
||||
|
|
2
Dependencies/GLFW
vendored
2
Dependencies/GLFW
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 4a998e2742436818aaeb3f194250b17d7871e152
|
||||
Subproject commit 62e175ef9fae75335575964c845a302447c012c7
|
2
Dependencies/entt
vendored
2
Dependencies/entt
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 59589b6a714579fbfac09a802d6bfc87e8bae7dd
|
||||
Subproject commit ebc0c18534a33afcd49878cadea2620bac5cc6bf
|
2
Dependencies/glm
vendored
2
Dependencies/glm
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 84f2045a79a4aa2454801a98e2de0401bd9c8aee
|
||||
Subproject commit cc98465e3508535ba8c7f6208df934c156a018dc
|
2
Dependencies/imgui
vendored
2
Dependencies/imgui
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 5f3925c45393cf5e82fd1b106a1548ad68baf52e
|
||||
Subproject commit 250333d895b1067533533dcfab137512745b9689
|
2
Dependencies/spdlog
vendored
2
Dependencies/spdlog
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 6491abb519a6a15792c1c6717270ce6c9ba4d72e
|
||||
Subproject commit dea6bb1085466370ed6d629b4d462f299db75958
|
2
Dependencies/spirv-cross
vendored
2
Dependencies/spirv-cross
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 3915c37bb184c66760f75e9b027d4229b1b1924a
|
||||
Subproject commit b3ff97d0feafd2b7ca72aec7215cfc3d0998fb79
|
2
Dependencies/yaml-cpp
vendored
2
Dependencies/yaml-cpp
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 0d9dbcfe8c0df699aed8ae050dddaca614178fb1
|
||||
Subproject commit 190ad502b5bc91b01fd2e73f5343cf7b40cfdc70
|
|
@ -1,12 +1,12 @@
|
|||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCC)
|
||||
add_compile_options(-w)
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
add_compile_options(-w)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
add_compile_options(/MP)
|
||||
add_compile_options(/W0)
|
||||
add_compile_options(/MP)
|
||||
add_compile_options(/W0)
|
||||
endif()
|
||||
|
||||
file(GLOB_RECURSE ENGINE_ALL_FILES true ABSOLUTE ${ENGINE_DIR}src/*)
|
||||
|
@ -14,51 +14,44 @@ file(GLOB_RECURSE ENGINE_RES_FILES true ABSOLUTE ${ENGINE_DIR}res/*)
|
|||
list(LENGTH ENGINE_ALL_FILES ENGINE_ALL_FILES_COUNT)
|
||||
|
||||
if(NOT WIN32)
|
||||
set (DX_DIR ${ENGINE_DIR}src/Platform/GraphicsAPI/DirectX/)
|
||||
set (WIN_DIR ${ENGINE_DIR}src/Platform/OS/Windows/)
|
||||
set(DX_DIR ${ENGINE_DIR}src/Platform/GraphicsAPI/DirectX/)
|
||||
set(WIN_DIR ${ENGINE_DIR}src/Platform/OS/Windows/)
|
||||
|
||||
list(REMOVE_ITEM ENGINE_ALL_FILES
|
||||
${DX_DIR}dxBlender.cpp
|
||||
${DX_DIR}dxBuffers.cpp
|
||||
${DX_DIR}dxFramebuffer.cpp
|
||||
${DX_DIR}dxGraphicsContext.cpp
|
||||
${DX_DIR}dxRenderCommand.cpp
|
||||
${DX_DIR}dxShader.cpp
|
||||
${DX_DIR}dxSharedContext.cpp
|
||||
${DX_DIR}dxTexture.cpp
|
||||
${DX_DIR}dxUserInterface.cpp
|
||||
${DX_DIR}dxVertexLayout.cpp
|
||||
${WIN_DIR}wWindow.cpp)
|
||||
list(
|
||||
REMOVE_ITEM ENGINE_ALL_FILES
|
||||
${DX_DIR}dxBlender.cpp
|
||||
${DX_DIR}dxBuffers.cpp
|
||||
${DX_DIR}dxFramebuffer.cpp
|
||||
${DX_DIR}dxGraphicsContext.cpp
|
||||
${DX_DIR}dxRenderCommand.cpp
|
||||
${DX_DIR}dxShader.cpp
|
||||
${DX_DIR}dxSharedContext.cpp
|
||||
${DX_DIR}dxTexture.cpp
|
||||
${DX_DIR}dxUserInterface.cpp
|
||||
${DX_DIR}dxVertexLayout.cpp
|
||||
${WIN_DIR}wWindow.cpp
|
||||
)
|
||||
else()
|
||||
file(GLOB_RECURSE HLSL_FILES true ABSOLUTE ${ENGINE_DIR}res/*.hlsl)
|
||||
set_source_files_properties(${HLSL_FILES} PROPERTIES VS_TOOL_OVERRIDE "None")
|
||||
file(GLOB_RECURSE HLSL_FILES true ABSOLUTE ${ENGINE_DIR}res/*.hlsl)
|
||||
set_source_files_properties(${HLSL_FILES} PROPERTIES VS_TOOL_OVERRIDE "None")
|
||||
endif()
|
||||
|
||||
list(LENGTH ENGINE_ALL_FILES ENGINE_ALL_FILES_COUNT)
|
||||
|
||||
include_directories(
|
||||
${ENGINE_DIR}src/Engine/
|
||||
${ENGINE_DIR}src/Platform/GraphicsAPI/
|
||||
${ENGINE_DIR}src/Platform/OS/
|
||||
${DEPENDENCIES_DIR}entt/src/
|
||||
${DEPENDENCIES_DIR}GLAD/include/
|
||||
${DEPENDENCIES_DIR}GLFW/include/
|
||||
${DEPENDENCIES_DIR}glm/
|
||||
${DEPENDENCIES_DIR}imgui/
|
||||
${DEPENDENCIES_DIR}spdlog/include/
|
||||
${DEPENDENCIES_DIR}stb_image/
|
||||
${DEPENDENCIES_DIR}yaml-cpp/include/
|
||||
${DEPENDENCIES_DIR}shaderc/libshaderc/include
|
||||
${ENGINE_DIR}src/Engine/
|
||||
${ENGINE_DIR}src/Platform/GraphicsAPI/
|
||||
${ENGINE_DIR}src/Platform/OS/
|
||||
${DEPENDENCIES_DIR}entt/src/
|
||||
${DEPENDENCIES_DIR}GLAD/include/
|
||||
${DEPENDENCIES_DIR}GLFW/include/
|
||||
${DEPENDENCIES_DIR}glm/
|
||||
${DEPENDENCIES_DIR}imgui/
|
||||
${DEPENDENCIES_DIR}spdlog/include/
|
||||
${DEPENDENCIES_DIR}stb_image/
|
||||
${DEPENDENCIES_DIR}yaml-cpp/include/
|
||||
${DEPENDENCIES_DIR}shaderc/libshaderc/include
|
||||
)
|
||||
|
||||
source_group(TREE ${ENGINE_DIR} FILES ${ENGINE_ALL_FILES} ${ENGINE_RES_FILES})
|
||||
add_library(Engine STATIC ${ENGINE_ALL_FILES} ${ENGINE_RES_FILES})
|
||||
|
||||
if(WIN32)
|
||||
target_link_libraries(Engine d3d11)
|
||||
target_link_libraries(Engine dxguid)
|
||||
target_link_libraries(Engine D3DCompiler)
|
||||
endif()
|
||||
|
||||
|
||||
message(BINARY DIRECTORY IS IN ${CMAKE_BINARY_DIR})
|
||||
|
|
|
@ -56,7 +56,7 @@ constexpr std::unique_ptr<T> MakeScope(T* rawPointer)
|
|||
#define LT_MAC(x) x
|
||||
|
||||
#else
|
||||
// #error "Unsupported platform: Unknown"
|
||||
#error "Unsupported platform: Unknown"
|
||||
#endif
|
||||
//========== PLATFORM ==========//
|
||||
|
||||
|
|
|
@ -46,4 +46,4 @@ protected:
|
|||
Blender() = default;
|
||||
};
|
||||
|
||||
} // namespace Light
|
||||
} // namespace Light
|
||||
|
|
Loading…
Add table
Reference in a new issue