Skip to content

Commit

Permalink
Merge pull request #13 from G-Epitech/12-fix-cmakelists-includes
Browse files Browse the repository at this point in the history
Fix CMakeLists includes
  • Loading branch information
flavien-chenu authored Mar 25, 2024
2 parents 7e0cc36 + d85b215 commit f919d4d
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 40 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,3 @@ set(CMAKE_SHARED_LIBRARY_PREFIX "arcade_")
add_subdirectory(core)
add_subdirectory(games)
add_subdirectory(graphics)

target_include_directories (arcade PUBLIC ${CMAKE_CURRENT_LIST_DIR}/common/)
2 changes: 1 addition & 1 deletion common/games/components/IComponent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ class shared::games::components::IComponent {
*
* @return Entity of the component
*/
virtual std::shared_ptr<entity::IEntity> getEntity() noexcept = 0;
virtual const entity::IEntity &getEntity() noexcept = 0;
};
4 changes: 2 additions & 2 deletions common/types/Libraries.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace shared::types
GRAPHIC,
} LibraryType;

typedef std::shared_ptr<shared::games::IGameProvider> (*GameProvider)(void);
typedef std::shared_ptr<shared::graphics::IGraphicsProvider> (*GraphicsProvider)(void);
typedef std::shared_ptr<games::IGameProvider> (*GameProvider)(void);
typedef std::shared_ptr<graphics::IGraphicsProvider> (*GraphicsProvider)(void);
typedef LibraryType (*LibraryTypeGetter)(void);
}
1 change: 0 additions & 1 deletion common/types/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@

#include "Vector.hpp"
#include "UUId.hpp"
#include "Libraries.hpp"
8 changes: 4 additions & 4 deletions games/snake/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
project(snake)

add_library(${PROJECT_NAME} SHARED
src/main.cpp
add_library(snake SHARED
export.cpp
)
target_include_directories(snake PUBLIC ${CMAKE_CURRENT_LIST_DIR}/src)
target_include_directories(snake PUBLIC ${CMAKE_CURRENT_LIST_DIR}/../..)
21 changes: 21 additions & 0 deletions games/snake/export.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
** EPITECH PROJECT, 2024
** arcade-shared
** File description:
** export
*/

#include "common/games/IGameProvider.hpp"
#include "common/types/Libraries.hpp"

extern "C" {
shared::types::LibraryType SHARED_LIBRARY_TYPE_GETTER_NAME(void)
{
return shared::types::LibraryType::GAME;
}

/* std::shared_ptr<shared::games::IGameProvider> SHARED_GAME_PROVIDER_LOADER_NAME(void)
{
return std::make_shared<GameClass>(...)
}*/
}
13 changes: 0 additions & 13 deletions games/snake/src/main.cpp

This file was deleted.

8 changes: 4 additions & 4 deletions graphics/ncurses/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
project(ncurses)

add_library(${PROJECT_NAME} SHARED
src/main.cpp
add_library(ncurses SHARED
export.cpp
)
target_include_directories(ncurses PUBLIC ${CMAKE_CURRENT_LIST_DIR}/src)
target_include_directories(ncurses PUBLIC ${CMAKE_CURRENT_LIST_DIR}/../..)
22 changes: 22 additions & 0 deletions graphics/ncurses/export.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
** EPITECH PROJECT, 2024
** arcade-shared
** File description:
** export
*/

#include "common/games/IGameProvider.hpp"
#include "common/types/Libraries.hpp"

extern "C" {
shared::types::LibraryType SHARED_LIBRARY_TYPE_GETTER_NAME(void)
{
return shared::types::LibraryType::GRAPHIC;
}

/* std::shared_ptr<shared::graphics::IGraphicsProvider> SHARED_GRAPHICS_PROVIDER_LOADER_NAME(void)
{
return std::make_shared<RendererClass>(...);
}*/
}

13 changes: 0 additions & 13 deletions graphics/ncurses/src/main.cpp

This file was deleted.

0 comments on commit f919d4d

Please sign in to comment.