diff --git a/.gitmodules b/.gitmodules index c354cb32..73878c7f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "third-party/fmt"] path = third-party/fmt url = https://github.com/fmtlib/fmt.git +[submodule "third-party/spdlog"] + path = third-party/spdlog + url = https://github.com/gabime/spdlog diff --git a/CMakeLists.txt b/CMakeLists.txt index ded597dc..70b5d77a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,4 +18,4 @@ add_executable(shadps4 find_package(OpenGL REQUIRED) -target_link_libraries(shadps4 PUBLIC fmt IMGUI SDL3-shared ${OPENGL_LIBRARY}) \ No newline at end of file +target_link_libraries(shadps4 PUBLIC fmt spdlog IMGUI SDL3-shared ${OPENGL_LIBRARY}) \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 612be430..b10a4921 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -14,7 +14,7 @@ #include #endif -#include +#include "spdlog/spdlog.h" // This example can also compile and run with Emscripten! See 'Makefile.emscripten' for details. #ifdef __EMSCRIPTEN__ @@ -24,7 +24,7 @@ // Main code int main(int, char**) { - fmt::print("Hello, world!\n"); + spdlog::info("Welcome to spdlog!"); // Setup SDL if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_GAMEPAD) != 0) { diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt index cd0ec0f0..1d50afaf 100644 --- a/third-party/CMakeLists.txt +++ b/third-party/CMakeLists.txt @@ -2,6 +2,14 @@ set(fmt_DIR ${CMAKE_CURRENT_SOURCE_DIR}/fmt) add_subdirectory(${fmt_DIR}) +#=================== SPD ==================== +set(SPDLOG_WCHAR_FILENAMES ON CACHE BOOL "") +set(SPDLOG_NO_THREAD_ID ON CACHE BOOL "") +set(SPDLOG_FMT_EXTERNAL ON CACHE BOOL "") +add_subdirectory(spdlog EXCLUDE_FROM_ALL) +add_library(stb INTERFACE) +target_include_directories(stb INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/stb") + #=================== SDL3 =================== set(SDL3_DIR ${CMAKE_CURRENT_SOURCE_DIR}/SDL) diff --git a/third-party/spdlog b/third-party/spdlog new file mode 160000 index 00000000..c65aa4e4 --- /dev/null +++ b/third-party/spdlog @@ -0,0 +1 @@ +Subproject commit c65aa4e4889939c1afa82001db349cac237a13f8