From 61e5bcef2629e2d68b805a956a96fff264d4f74d Mon Sep 17 00:00:00 2001 From: untodesu Date: Sat, 28 Jun 2025 01:59:49 +0500 Subject: Restructure dependencies and update to C++20 - Nuked static_assert from almost everywhere in the project - Nuked binary dependency support. Might add one later though - Separated dependency headers into a separate include subdirectory - Grafted a thirdpartylegalnotices.txt generator from RITEG - Pushed development snapshot version to 2126 (26th week of 2025) --- deps/CMakeLists.txt | 83 +++++++++++------------------------------------------ 1 file changed, 16 insertions(+), 67 deletions(-) (limited to 'deps/CMakeLists.txt') diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index c8c4b52..e5cc4a7 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -1,67 +1,16 @@ -set(DEPS_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/include") -set(DEPS_LIBRARY_DIR "${CMAKE_CURRENT_LIST_DIR}/lib") - -if(WIN32 AND NOT MINGW) - set(DEPS_LIBRARY_DIR "${DEPS_LIBRARY_DIR}/win") -elseif(WIN32 AND MINGW) - set(DEPS_LIBRARY_DIR "${DEPS_LIBRARY_DIR}/mingw") -elseif(UNIX AND NOT APPLE) - set(DEPS_LIBRARY_DIR "${DEPS_LIBRARY_DIR}/linux") -elseif(UNIX AND APPLE) - set(DEPS_LIBRARY_DIR "${DEPS_LIBRARY_DIR}/apple") -else() - message(FATAL_ERROR "Unsupported target platform") -endif() - -if(CMAKE_SIZEOF_VOID_P EQUAL 4) - set(DEPS_LIBRARY_DIR "${DEPS_LIBRARY_DIR}32") -elseif(CMAKE_SIZEOF_VOID_P EQUAL 8) - set(DEPS_LIBRARY_DIR "${DEPS_LIBRARY_DIR}64") -else() - message(FATAL_ERROR "Unsupported CMAKE_SIZEOF_VOID_P") -endif() - -function(import_shared_library library) - add_library(${library} SHARED IMPORTED GLOBAL) - set_target_properties(${library} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${DEPS_INCLUDE_DIR}") - set_target_properties(${library} PROPERTIES IMPORTED_LOCATION "${DEPS_LIBRARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}${library}${CMAKE_SHARED_LIBRARY_SUFFIX}") - set_target_properties(${library} PROPERTIES IMPORTED_IMPLIB "${DEPS_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${library}${CMAKE_STATIC_LIBRARY_SUFFIX}") - install(FILES "${DEPS_LIBRARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}${library}${CMAKE_SHARED_LIBRARY_SUFFIX}" RUNTIME DESTINATION ".") -endfunction() - -function(import_static_library library) - add_library(${library} STATIC IMPORTED GLOBAL) - set_target_properties(${library} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${DEPS_INCLUDE_DIR}") - set_target_properties(${library} PROPERTIES IMPORTED_LOCATION "${DEPS_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${library}${CMAKE_STATIC_LIBRARY_SUFFIX}") -endfunction() - -set(PHYSFS_ARCHIVE_ZIP ON CACHE BOOL "" FORCE) -set(PHYSFS_ARCHIVE_7Z ON CACHE BOOL "" FORCE) - -find_package(glfw3 3.4 QUIET) - -if(NOT glfw3_FOUND) - include(FetchContent) - set(GLFW_INSTALL OFF CACHE BOOL "" FORCE) - set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE) - set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE) - set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) - FetchContent_Declare(glfw GIT_REPOSITORY https://github.com/glfw/glfw.git GIT_TAG 3.4) - FetchContent_MakeAvailable(glfw) - add_library(glfw3 ALIAS glfw) -endif() - -add_subdirectory(src/dr_libs) -add_subdirectory(src/enet) -add_subdirectory(src/fastnoiselite) -add_subdirectory(src/glad) -add_subdirectory(src/imgui) -add_subdirectory(src/miniz) -add_subdirectory(src/parson) -add_subdirectory(src/physfs) -add_subdirectory(src/salad) -add_subdirectory(src/spdlog) -add_subdirectory(src/stb) - -set(DEPS_INCLUDE_DIR "${DEPS_INCLUDE_DIR}" PARENT_SCOPE) -set(DEPS_LIBRARY_DIR "${DEPS_LIBRARY_DIR}" PARENT_SCOPE) +add_subdirectory(dr_libs) +add_subdirectory(emhash) +add_subdirectory(enet) +add_subdirectory(entt) +add_subdirectory(fastnoiselite) +add_subdirectory(glad) +add_subdirectory(glfw) +add_subdirectory(glm) +add_subdirectory(imgui) +add_subdirectory(miniz) +add_subdirectory(parson) +add_subdirectory(physfs) +add_subdirectory(salad) +add_subdirectory(spdlog) +add_subdirectory(stb) +add_subdirectory(thread_pool) -- cgit