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_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||||
|
|
||||||
set(MIRROR_DIR ${CMAKE_BINARY_DIR}/../Mirror/)
|
set(MIRROR_DIR ${CMAKE_BINARY_DIR}/../Mirror/)
|
||||||
set(ENGINE_DIR ${CMAKE_BINARY_DIR}/../Engine/)
|
set(ENGINE_DIR ${CMAKE_BINARY_DIR}/../Engine/)
|
||||||
set(DEPENDENCIES_DIR ${CMAKE_BINARY_DIR}/../Dependencies/)
|
set(DEPENDENCIES_DIR ${CMAKE_BINARY_DIR}/../Dependencies/)
|
||||||
|
|
||||||
if(NOT MSV)
|
if(NOT MSV)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
add_compile_definitions(LIGHT_PLATFORM_WINDOWS)
|
add_compile_definitions(LIGHT_PLATFORM_WINDOWS)
|
||||||
elseif(UNIX)
|
elseif(UNIX)
|
||||||
add_compile_definitions(LIGHT_PLATFORM_LINUX)
|
add_compile_definitions(LIGHT_PLATFORM_LINUX)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Projects
|
# Projects
|
||||||
|
@ -39,30 +39,33 @@ add_subdirectory(${DEPENDENCIES_DIR}shaderc/)
|
||||||
|
|
||||||
# Link
|
# Link
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
imgui
|
imgui
|
||||||
PUBLIC glad
|
PUBLIC glad
|
||||||
PUBLIC glfw)
|
PUBLIC glfw
|
||||||
|
)
|
||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
Engine
|
Engine
|
||||||
PRIVATE glad
|
PRIVATE glad
|
||||||
PRIVATE glfw
|
PRIVATE glfw
|
||||||
PRIVATE spdlog
|
PRIVATE spdlog
|
||||||
PRIVATE imgui
|
PRIVATE imgui
|
||||||
PRIVATE stb_image
|
PRIVATE stb_image
|
||||||
PRIVATE yaml-cpp
|
PRIVATE yaml-cpp
|
||||||
PRIVATE shaderc)
|
PRIVATE shaderc
|
||||||
|
)
|
||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
Mirror
|
Mirror
|
||||||
PRIVATE Engine
|
PRIVATE Engine
|
||||||
PRIVATE imgui)
|
PRIVATE imgui
|
||||||
|
)
|
||||||
|
|
||||||
# Precompiled headers
|
# Precompiled headers
|
||||||
target_precompile_headers(Engine PUBLIC ${ENGINE_DIR}src/Engine/ltpch.hpp)
|
target_precompile_headers(Engine PUBLIC ${ENGINE_DIR}src/Engine/ltpch.hpp)
|
||||||
|
|
||||||
if(MSVC)
|
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()
|
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)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
if (CMAKE_COMPILER_IS_GNUCC)
|
if(CMAKE_COMPILER_IS_GNUCC)
|
||||||
add_compile_options(-w)
|
add_compile_options(-w)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
add_compile_options(/MP)
|
add_compile_options(/MP)
|
||||||
add_compile_options(/W0)
|
add_compile_options(/W0)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
file(GLOB_RECURSE ENGINE_ALL_FILES true ABSOLUTE ${ENGINE_DIR}src/*)
|
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)
|
list(LENGTH ENGINE_ALL_FILES ENGINE_ALL_FILES_COUNT)
|
||||||
|
|
||||||
if(NOT WIN32)
|
if(NOT WIN32)
|
||||||
set (DX_DIR ${ENGINE_DIR}src/Platform/GraphicsAPI/DirectX/)
|
set(DX_DIR ${ENGINE_DIR}src/Platform/GraphicsAPI/DirectX/)
|
||||||
set (WIN_DIR ${ENGINE_DIR}src/Platform/OS/Windows/)
|
set(WIN_DIR ${ENGINE_DIR}src/Platform/OS/Windows/)
|
||||||
|
|
||||||
list(REMOVE_ITEM ENGINE_ALL_FILES
|
list(
|
||||||
${DX_DIR}dxBlender.cpp
|
REMOVE_ITEM ENGINE_ALL_FILES
|
||||||
${DX_DIR}dxBuffers.cpp
|
${DX_DIR}dxBlender.cpp
|
||||||
${DX_DIR}dxFramebuffer.cpp
|
${DX_DIR}dxBuffers.cpp
|
||||||
${DX_DIR}dxGraphicsContext.cpp
|
${DX_DIR}dxFramebuffer.cpp
|
||||||
${DX_DIR}dxRenderCommand.cpp
|
${DX_DIR}dxGraphicsContext.cpp
|
||||||
${DX_DIR}dxShader.cpp
|
${DX_DIR}dxRenderCommand.cpp
|
||||||
${DX_DIR}dxSharedContext.cpp
|
${DX_DIR}dxShader.cpp
|
||||||
${DX_DIR}dxTexture.cpp
|
${DX_DIR}dxSharedContext.cpp
|
||||||
${DX_DIR}dxUserInterface.cpp
|
${DX_DIR}dxTexture.cpp
|
||||||
${DX_DIR}dxVertexLayout.cpp
|
${DX_DIR}dxUserInterface.cpp
|
||||||
${WIN_DIR}wWindow.cpp)
|
${DX_DIR}dxVertexLayout.cpp
|
||||||
|
${WIN_DIR}wWindow.cpp
|
||||||
|
)
|
||||||
else()
|
else()
|
||||||
file(GLOB_RECURSE HLSL_FILES true ABSOLUTE ${ENGINE_DIR}res/*.hlsl)
|
file(GLOB_RECURSE HLSL_FILES true ABSOLUTE ${ENGINE_DIR}res/*.hlsl)
|
||||||
set_source_files_properties(${HLSL_FILES} PROPERTIES VS_TOOL_OVERRIDE "None")
|
set_source_files_properties(${HLSL_FILES} PROPERTIES VS_TOOL_OVERRIDE "None")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
list(LENGTH ENGINE_ALL_FILES ENGINE_ALL_FILES_COUNT)
|
list(LENGTH ENGINE_ALL_FILES ENGINE_ALL_FILES_COUNT)
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
${ENGINE_DIR}src/Engine/
|
${ENGINE_DIR}src/Engine/
|
||||||
${ENGINE_DIR}src/Platform/GraphicsAPI/
|
${ENGINE_DIR}src/Platform/GraphicsAPI/
|
||||||
${ENGINE_DIR}src/Platform/OS/
|
${ENGINE_DIR}src/Platform/OS/
|
||||||
${DEPENDENCIES_DIR}entt/src/
|
${DEPENDENCIES_DIR}entt/src/
|
||||||
${DEPENDENCIES_DIR}GLAD/include/
|
${DEPENDENCIES_DIR}GLAD/include/
|
||||||
${DEPENDENCIES_DIR}GLFW/include/
|
${DEPENDENCIES_DIR}GLFW/include/
|
||||||
${DEPENDENCIES_DIR}glm/
|
${DEPENDENCIES_DIR}glm/
|
||||||
${DEPENDENCIES_DIR}imgui/
|
${DEPENDENCIES_DIR}imgui/
|
||||||
${DEPENDENCIES_DIR}spdlog/include/
|
${DEPENDENCIES_DIR}spdlog/include/
|
||||||
${DEPENDENCIES_DIR}stb_image/
|
${DEPENDENCIES_DIR}stb_image/
|
||||||
${DEPENDENCIES_DIR}yaml-cpp/include/
|
${DEPENDENCIES_DIR}yaml-cpp/include/
|
||||||
${DEPENDENCIES_DIR}shaderc/libshaderc/include
|
${DEPENDENCIES_DIR}shaderc/libshaderc/include
|
||||||
)
|
)
|
||||||
|
|
||||||
source_group(TREE ${ENGINE_DIR} FILES ${ENGINE_ALL_FILES} ${ENGINE_RES_FILES})
|
source_group(TREE ${ENGINE_DIR} FILES ${ENGINE_ALL_FILES} ${ENGINE_RES_FILES})
|
||||||
add_library(Engine STATIC ${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
|
#define LT_MAC(x) x
|
||||||
|
|
||||||
#else
|
#else
|
||||||
// #error "Unsupported platform: Unknown"
|
#error "Unsupported platform: Unknown"
|
||||||
#endif
|
#endif
|
||||||
//========== PLATFORM ==========//
|
//========== PLATFORM ==========//
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue