Updated build env
This commit is contained in:
+2
-1
@@ -39,4 +39,5 @@ endif()
|
|||||||
|
|
||||||
add_subdirectory(third_party)
|
add_subdirectory(third_party)
|
||||||
add_subdirectory(engine)
|
add_subdirectory(engine)
|
||||||
add_subdirectory(testbed)
|
add_subdirectory(testbed)
|
||||||
|
add_subdirectory(examples)
|
||||||
+13
-6
@@ -5,14 +5,21 @@ add_library(${ENGINE_NAME} STATIC)
|
|||||||
file(GLOB_RECURSE SOURCES src/*.cpp)
|
file(GLOB_RECURSE SOURCES src/*.cpp)
|
||||||
file(GLOB_RECURSE HEADERS include/*.hpp)
|
file(GLOB_RECURSE HEADERS include/*.hpp)
|
||||||
|
|
||||||
target_sources(${ENGINE_NAME} PRIVATE
|
target_sources(${ENGINE_NAME} PRIVATE
|
||||||
${SOURCES}
|
${SOURCES}
|
||||||
# ${HEADERS}
|
)
|
||||||
|
|
||||||
|
target_include_directories(${ENGINE_NAME} PRIVATE
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/src"
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(${ENGINE_NAME} PUBLIC
|
target_include_directories(${ENGINE_NAME} PUBLIC
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/src"
|
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/include"
|
"${CMAKE_CURRENT_SOURCE_DIR}/include"
|
||||||
"${CMAKE_SOURCE_DIR}/third_party/imgui"
|
)
|
||||||
"${CMAKE_SOURCE_DIR}/third_party/imgui/backends"
|
|
||||||
|
target_link_libraries(${ENGINE_NAME} PUBLIC
|
||||||
|
vulkan
|
||||||
|
glfw
|
||||||
|
glm
|
||||||
|
imgui
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
file(GLOB EXAMPLE_DIRS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*)
|
||||||
|
|
||||||
|
foreach(dir ${EXAMPLE_DIRS})
|
||||||
|
if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${dir} AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/CMakeLists.txt)
|
||||||
|
add_subdirectory(${dir})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
add_executable(triangle main.cpp)
|
||||||
|
|
||||||
|
target_link_libraries(triangle PRIVATE ${PROJECT_NAME})
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
#include <sophia/application.hpp>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
sophia::Application app{{.width = 800, .height = 600, .name = "Triangle"}};
|
||||||
|
|
||||||
|
app.run();
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
+6
-2
@@ -1,11 +1,15 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <sophia/application.hpp>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
int main(int argc, const char **argv)
|
int main(int argc, const char** argv) {
|
||||||
{
|
|
||||||
(void)argc;
|
(void)argc;
|
||||||
(void)argv;
|
(void)argv;
|
||||||
std::cout << __FILE__ << "::" << __LINE__ << '\n';
|
std::cout << __FILE__ << "::" << __LINE__ << '\n';
|
||||||
|
|
||||||
|
sophia::Application app{{.width = 750, .height = 1000, .name = "Testbed"}};
|
||||||
|
|
||||||
|
app.run();
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user