Project reorganization.
This commit is contained in:
parent
8b0a7f2622
commit
39732c1a27
|
|
@ -10,4 +10,5 @@ set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS -Wall)
|
set(CMAKE_CXX_FLAGS -Wall)
|
||||||
|
|
||||||
add_subdirectory("aster_core")
|
add_subdirectory("aster")
|
||||||
|
add_subdirectory("triangle")
|
||||||
|
|
|
||||||
|
|
@ -10,18 +10,17 @@ find_package(Vulkan REQUIRED)
|
||||||
find_package(fmt CONFIG REQUIRED)
|
find_package(fmt CONFIG REQUIRED)
|
||||||
find_package(VulkanMemoryAllocator CONFIG REQUIRED)
|
find_package(VulkanMemoryAllocator CONFIG REQUIRED)
|
||||||
|
|
||||||
set(HEADER_FILES "constants.h" "config.h" "logger.h" "global.h" "context.h" "window.h")
|
set(HEADER_FILES constants.h config.h logger.h global.h context.h window.h)
|
||||||
set(SOURCE_FILES "logger.cpp" "global.cpp" "context.cpp" "window.cpp")
|
set(SOURCE_FILES logger.cpp global.cpp context.cpp window.cpp)
|
||||||
|
|
||||||
add_library(aster_core ${SOURCE_FILES} ${HEADER_FILES})
|
add_library(aster_core STATIC ${SOURCE_FILES} ${HEADER_FILES})
|
||||||
set_property(TARGET aster_core PROPERTY CXX_STANDARD 20)
|
set_property(TARGET aster_core PROPERTY CXX_STANDARD 20)
|
||||||
|
|
||||||
target_link_libraries(aster_core PRIVATE glm::glm-header-only)
|
target_include_directories(aster_core PUBLIC ${CMAKE_SOURCE_DIR})
|
||||||
|
|
||||||
|
target_link_libraries(aster_core PUBLIC glm::glm-header-only)
|
||||||
target_link_libraries(aster_core PRIVATE glfw)
|
target_link_libraries(aster_core PRIVATE glfw)
|
||||||
target_include_directories(aster_core PRIVATE ${SCOTTT_DEBUGBREAK_INCLUDE_DIRS})
|
target_include_directories(aster_core PRIVATE ${SCOTTT_DEBUGBREAK_INCLUDE_DIRS})
|
||||||
target_link_libraries(aster_core PRIVATE fmt::fmt)
|
target_link_libraries(aster_core PRIVATE fmt::fmt)
|
||||||
target_link_libraries(aster_core PRIVATE Vulkan::Vulkan Vulkan::Headers GPUOpen::VulkanMemoryAllocator)
|
target_link_libraries(aster_core PRIVATE Vulkan::Vulkan Vulkan::Headers GPUOpen::VulkanMemoryAllocator)
|
||||||
|
|
||||||
add_executable(aster_exe "aster.cpp")
|
|
||||||
target_link_libraries(aster_exe PRIVATE aster_core)
|
|
||||||
target_link_libraries(aster_exe PRIVATE glm::glm-header-only)
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
# CMakeList.txt ; CMake project for Aster Core
|
||||||
|
|
||||||
|
cmake_minimum_required(VERSION 3.13)
|
||||||
|
|
||||||
|
add_executable(aster_exe "aster.cpp")
|
||||||
|
add_dependencies(aster_exe aster_core)
|
||||||
|
|
||||||
|
target_link_libraries(aster_exe PRIVATE aster_core)
|
||||||
|
|
@ -1,12 +1,15 @@
|
||||||
#include "constants.h"
|
#include "aster/constants.h"
|
||||||
#include "glfw_context.h"
|
#include "aster/glfw_context.h"
|
||||||
#include "window.h"
|
#include "aster/window.h"
|
||||||
|
|
||||||
int main(int, char **) {
|
int main(int, char **) {
|
||||||
GlfwContext *glfw = new GlfwContext();
|
GlfwContext *glfw = new GlfwContext();
|
||||||
Context *context = new Context("Aster", VERSION);
|
Context *context = new Context("Aster", VERSION);
|
||||||
Window *window = new Window("Aster1", context, { 640, 480 });
|
Window *window = new Window("Aster1", context, { 640, 480 });
|
||||||
|
|
||||||
|
while (window->poll()) {
|
||||||
|
}
|
||||||
|
|
||||||
delete window;
|
delete window;
|
||||||
delete context;
|
delete context;
|
||||||
delete glfw;
|
delete glfw;
|
||||||
Loading…
Reference in New Issue