libweaver: support system library and use latest wip read flags (#735)

* Use system libweaver when DOWNLOAD_DEPENDENCIES is disabled

* Update to latest libweaver master
This commit is contained in:
Anonymous Maarten 2025-11-23 01:26:54 +01:00 committed by GitHub
parent 85ff14e997
commit a90c7cb985
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 18 additions and 15 deletions

View File

@ -52,19 +52,20 @@ if(DOWNLOAD_DEPENDENCIES)
include(FetchContent) include(FetchContent)
FetchContent_Populate( FetchContent_Populate(
libweaver libweaver
URL https://github.com/isledecomp/SIEdit/archive/ae447259389f3bf8273c7e7a4844743faf7cbdb8.tar.gz URL https://github.com/isledecomp/SIEdit/archive/afd4933844b95ef739a7e77b097deb7efe4ec576.tar.gz
URL_MD5 dee68424fde8db6d5cef3b9034a8151f URL_MD5 59fd3c36f4f380f730cd9bedfc846397
) )
else() add_library(libweaver STATIC
set(libweaver_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libweaver") ${libweaver_SOURCE_DIR}/lib/core.cpp
${libweaver_SOURCE_DIR}/lib/file.cpp
${libweaver_SOURCE_DIR}/lib/interleaf.cpp
${libweaver_SOURCE_DIR}/lib/object.cpp
${libweaver_SOURCE_DIR}/lib/sitypes.cpp
)
add_library(libweaver::libweaver ALIAS libweaver)
target_compile_definitions(libweaver PRIVATE $<$<BOOL:${WIN32}>:NOMINMAX>)
target_include_directories(libweaver PUBLIC ${libweaver_SOURCE_DIR}/include/libweaver)
set_property(TARGET libweaver PROPERTY CXX_STANDARD 98)
set_property(TARGET libweaver PROPERTY CXX_STANDARD_REQUIRED ON)
endif() endif()
add_library(libweaver STATIC
${libweaver_SOURCE_DIR}/lib/core.cpp
${libweaver_SOURCE_DIR}/lib/file.cpp
${libweaver_SOURCE_DIR}/lib/interleaf.cpp
${libweaver_SOURCE_DIR}/lib/object.cpp
${libweaver_SOURCE_DIR}/lib/sitypes.cpp
)
add_library(libweaver::libweaver ALIAS libweaver)
target_include_directories(libweaver PUBLIC ${libweaver_SOURCE_DIR}/lib)

View File

@ -135,6 +135,8 @@ else()
find_package(iniparser REQUIRED CONFIG COMPONENTS shared) find_package(iniparser REQUIRED CONFIG COMPONENTS shared)
target_link_libraries(Isle::iniparser INTERFACE iniparser-shared) target_link_libraries(Isle::iniparser INTERFACE iniparser-shared)
find_package(libweaver REQUIRED)
endif() endif()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

View File

@ -242,10 +242,10 @@ bool SiLoader::LoadFile(const char* p_file)
MxString path = MxString(MxOmni::GetHD()) + p_file; MxString path = MxString(MxOmni::GetHD()) + p_file;
path.MapPathToFilesystem(); path.MapPathToFilesystem();
if (si.Read(path.GetData(), si::Interleaf::ObjectsOnly | si::Interleaf::NoInfo) != si::Interleaf::ERROR_SUCCESS) { if (si.Read(path.GetData(), si::Interleaf::ObjectsOnly) != si::Interleaf::ERROR_SUCCESS) {
path = MxString(MxOmni::GetCD()) + p_file; path = MxString(MxOmni::GetCD()) + p_file;
path.MapPathToFilesystem(); path.MapPathToFilesystem();
if (si.Read(path.GetData(), si::Interleaf::ObjectsOnly | si::Interleaf::NoInfo) != if (si.Read(path.GetData(), si::Interleaf::ObjectsOnly) !=
si::Interleaf::ERROR_SUCCESS) { si::Interleaf::ERROR_SUCCESS) {
SDL_Log("Could not parse SI file %s", p_file); SDL_Log("Could not parse SI file %s", p_file);
return false; return false;