Update CMake configuration and .clangd settings for improved build management

- Removed unnecessary compile flags from .clangd to streamline configuration.
- Added YAZE_BUILD_LIB option in CMakeLists.txt for conditional library building in minimal builds.
- Enhanced SDL2 CMake configuration to set include directories for bundled SDL, ensuring proper integration.
- Updated test CMakeLists.txt to conditionally link yaze_c and ImGuiTestEngine based on build options, improving modularity and flexibility.
- Refactored test_editor.cc and test_editor.h to conditionally include ImGuiTestEngine headers and manage engine initialization based on availability.
This commit is contained in:
scawful
2025-09-26 13:51:02 -04:00
parent 53787872b2
commit cbce2730b6
8 changed files with 55 additions and 11 deletions

View File

@@ -1,8 +1,15 @@
# SDL2
if (UNIX OR MINGW OR WIN32)
add_subdirectory(src/lib/SDL)
# When using bundled SDL, use the static target
# When using bundled SDL, use the static target and set include directories
set(SDL_TARGETS SDL2-static)
set(SDL2_INCLUDE_DIR
${CMAKE_SOURCE_DIR}/src/lib/SDL/include
${CMAKE_BINARY_DIR}/src/lib/SDL/include
${CMAKE_BINARY_DIR}/src/lib/SDL/include-config-${CMAKE_BUILD_TYPE}
)
# Also set for consistency with bundled SDL
set(SDL2_INCLUDE_DIRS ${SDL2_INCLUDE_DIR})
else()
find_package(SDL2)
# When using system SDL, use the imported targets