Updated build env
This commit is contained in:
@@ -40,3 +40,4 @@ endif()
|
||||
add_subdirectory(third_party)
|
||||
add_subdirectory(engine)
|
||||
add_subdirectory(testbed)
|
||||
add_subdirectory(examples)
|
||||
+11
-4
@@ -7,12 +7,19 @@ file(GLOB_RECURSE HEADERS include/*.hpp)
|
||||
|
||||
target_sources(${ENGINE_NAME} PRIVATE
|
||||
${SOURCES}
|
||||
# ${HEADERS}
|
||||
)
|
||||
|
||||
target_include_directories(${ENGINE_NAME} PRIVATE
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src"
|
||||
)
|
||||
|
||||
target_include_directories(${ENGINE_NAME} PUBLIC
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src"
|
||||
"${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 <sophia/application.hpp>
|
||||
#include <stdexcept>
|
||||
|
||||
int main(int argc, const char **argv)
|
||||
{
|
||||
int main(int argc, const char** argv) {
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
std::cout << __FILE__ << "::" << __LINE__ << '\n';
|
||||
|
||||
sophia::Application app{{.width = 750, .height = 1000, .name = "Testbed"}};
|
||||
|
||||
app.run();
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user