diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index d9ef558..2b63a86 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -1,4 +1,3 @@ -project(arcade) add_executable(${PROJECT_NAME} main.cpp ) diff --git a/core/src/exception/CMakeLists.txt b/core/src/exception/CMakeLists.txt index a591306..7f3f3dc 100644 --- a/core/src/exception/CMakeLists.txt +++ b/core/src/exception/CMakeLists.txt @@ -1,3 +1,3 @@ -target_sources(arcade PRIVATE +target_sources(${CMAKE_PROJECT_NAME} PRIVATE ArcadeError.cpp ) diff --git a/core/src/loader/CMakeLists.txt b/core/src/loader/CMakeLists.txt index 7b85e37..00db786 100644 --- a/core/src/loader/CMakeLists.txt +++ b/core/src/loader/CMakeLists.txt @@ -1,3 +1,3 @@ -target_sources(arcade PRIVATE +target_sources(${CMAKE_PROJECT_NAME} PRIVATE DLLoader.cpp ) diff --git a/core/src/loader/DLLoader.cpp b/core/src/loader/DLLoader.cpp index a1fb7e9..db5df71 100644 --- a/core/src/loader/DLLoader.cpp +++ b/core/src/loader/DLLoader.cpp @@ -11,7 +11,7 @@ #include "DLLoader.hpp" #include "exception/ArcadeError.hpp" -void DLLoader::_loadError(void *handle) { +void DLLoader::_throwLoadError(void *handle) { std::string error = dlerror(); if (this->_dir) @@ -26,7 +26,7 @@ shared::types::LibraryType DLLoader::_getLibraryGetter(const std::string &filepa getter = reinterpret_cast(dlsym(handle, SHARED_STRINGIFY(SHARED_LIBRARY_TYPE_GETTER_NAME))); if (!getter) - this->_loadError(handle); + this->_throwLoadError(handle); return getter(); } @@ -35,7 +35,7 @@ void DLLoader::_loadGameLibrary(const std::string &filepath, void *handle) { game = reinterpret_cast(dlsym(handle, SHARED_STRINGIFY(SHARED_GAME_PROVIDER_LOADER_NAME))); if (!game) - this->_loadError(handle); + this->_throwLoadError(handle); this->_gamesLibraries.push_back(game()); } @@ -44,7 +44,7 @@ void DLLoader::_loadGraphicsLibrary(const std::string &filepath, void *handle) { graphics = reinterpret_cast(dlsym(handle, SHARED_STRINGIFY(SHARED_GRAPHICS_PROVIDER_LOADER_NAME))); if (!graphics) - this->_loadError(handle); + this->_throwLoadError(handle); this->_graphicsLibraries.push_back(graphics()); } @@ -53,7 +53,7 @@ void DLLoader::registerLibrary(const std::string &filepath) { shared::types::LibraryType type; if (!handle) - this->_loadError(handle); + this->_throwLoadError(handle); dlerror(); type = this->_getLibraryGetter(filepath, handle); if (type == shared::types::LibraryType::GAME) diff --git a/core/src/loader/DLLoader.hpp b/core/src/loader/DLLoader.hpp index 4f3c51d..b204b4d 100644 --- a/core/src/loader/DLLoader.hpp +++ b/core/src/loader/DLLoader.hpp @@ -70,5 +70,5 @@ class DLLoader { * @brief Throw an error when loading a library * @param handle handle pointer to the library */ - void _loadError(void *handle); + void _throwLoadError(void *handle); };