Skip to content

Commit

Permalink
Fixed some bugs, removed some binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkauzh committed Dec 3, 2023
1 parent 4dfbe00 commit 6ec5342
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 2,829 deletions.
14 changes: 13 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ add_subdirectory(libs/glfw)
file(GLOB LIBRARY_SOURCES
"src/vuelto/core/*.cpp"
"src/vuelto/event/*.cpp"
"src/vuelto/shaders/*.cpp"
"src/vuelto/vendor/GLAD/src/*.c"
)

Expand All @@ -16,6 +17,7 @@ file(GLOB LIBRARY_HEADERS
"src/vuelto/core/*.hpp"
"src/vuelto/event/*.hpp"
"src/vuelto/tools/*.hpp"
"src/vuelto/shaders/*.hpp"
"src/vuelto/vendor/GLFW/*.h"
"src/vuelto/vendor/GLAD/include/glad/*.h"
)
Expand All @@ -32,6 +34,16 @@ target_include_directories(vuelto PUBLIC
$<INSTALL_INTERFACE:include>
)

# Copy header files with folder structure under src
foreach(HEADER ${LIBRARY_HEADERS})
file(RELATIVE_PATH HEADER_RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/src ${HEADER})
get_filename_component(HEADER_NAME ${HEADER} NAME)
get_filename_component(HEADER_PATH ${HEADER_RELATIVE} DIRECTORY)

file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/vuelto/${HEADER_PATH})
file(COPY ${HEADER} DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/include/vuelto/${HEADER_PATH})
endforeach()

# Link GLFW to the library
target_link_libraries(vuelto PUBLIC glfw)

Expand All @@ -54,7 +66,7 @@ set_target_properties(vuelto PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT

# Add -Wdeprecated-declarations for GCC and Clang
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR CMAKE_C_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wdeprecated-declarations "-W#warnings")
add_compile_options(-Wdeprecated-declarations)
endif()

# Optionally, create an executable for testing
Expand Down
2 changes: 1 addition & 1 deletion include/vuelto/Vuelto.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// core
#include "vuelto/core/app.hpp"
#include "vuelto/core/renderer.hpp"
#include "vuelto/core/shader.hpp"
#include "vuelto/shaders/shader.hpp"

// event
#include "vuelto/event/event.hpp"
Expand Down
7 changes: 1 addition & 6 deletions include/vuelto/vuelto/core/app.hpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
#pragma once

// clang-format off
#include "../vendor/GLAD/include/glad/glad.h"
#include <GLFW/glfw3.h>
// clang-format on

// #include "../tools/definitions.hpp"
#include "../tools/definitions.hpp"

namespace Vuelto {

Expand Down
1 change: 0 additions & 1 deletion include/vuelto/vuelto/core/renderer.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#pragma once

// #include "../tools/definitions.hpp"
#include "app.hpp"

namespace Vuelto {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#include <iostream>

namespace Vuelto {
namespace Shader {

Expand Down
18 changes: 4 additions & 14 deletions include/vuelto/vuelto/tools/definitions.hpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
#ifdef __APPLE__

// #define __gl_h_
#define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
// #include <OpenGL/gl.h> // For macOS
#elif defined _WIN32 || defined _WIN64

#else

#include <GL/glew.h> // For other platforms

#endif

#define GLFW_INCLUDE_NONE
// clang-format off
#include "../vendor/GLAD/include/glad/glad.h"
#define GLFW_NO_OPENGL_INIT
#include "../vendor/GLFW/glfw3.h"
// clang-format on
Loading

0 comments on commit 6ec5342

Please sign in to comment.