mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-10 18:21:14 +00:00
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:
parent
85ff14e997
commit
a90c7cb985
15
3rdparty/CMakeLists.txt
vendored
15
3rdparty/CMakeLists.txt
vendored
@ -52,13 +52,9 @@ if(DOWNLOAD_DEPENDENCIES)
|
||||
include(FetchContent)
|
||||
FetchContent_Populate(
|
||||
libweaver
|
||||
URL https://github.com/isledecomp/SIEdit/archive/ae447259389f3bf8273c7e7a4844743faf7cbdb8.tar.gz
|
||||
URL_MD5 dee68424fde8db6d5cef3b9034a8151f
|
||||
URL https://github.com/isledecomp/SIEdit/archive/afd4933844b95ef739a7e77b097deb7efe4ec576.tar.gz
|
||||
URL_MD5 59fd3c36f4f380f730cd9bedfc846397
|
||||
)
|
||||
else()
|
||||
set(libweaver_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libweaver")
|
||||
endif()
|
||||
|
||||
add_library(libweaver STATIC
|
||||
${libweaver_SOURCE_DIR}/lib/core.cpp
|
||||
${libweaver_SOURCE_DIR}/lib/file.cpp
|
||||
@ -67,4 +63,9 @@ add_library(libweaver STATIC
|
||||
${libweaver_SOURCE_DIR}/lib/sitypes.cpp
|
||||
)
|
||||
add_library(libweaver::libweaver ALIAS libweaver)
|
||||
target_include_directories(libweaver PUBLIC ${libweaver_SOURCE_DIR}/lib)
|
||||
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()
|
||||
|
||||
|
||||
@ -135,6 +135,8 @@ else()
|
||||
|
||||
find_package(iniparser REQUIRED CONFIG COMPONENTS shared)
|
||||
target_link_libraries(Isle::iniparser INTERFACE iniparser-shared)
|
||||
|
||||
find_package(libweaver REQUIRED)
|
||||
endif()
|
||||
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
@ -242,10 +242,10 @@ bool SiLoader::LoadFile(const char* p_file)
|
||||
|
||||
MxString path = MxString(MxOmni::GetHD()) + p_file;
|
||||
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.MapPathToFilesystem();
|
||||
if (si.Read(path.GetData(), si::Interleaf::ObjectsOnly | si::Interleaf::NoInfo) !=
|
||||
if (si.Read(path.GetData(), si::Interleaf::ObjectsOnly) !=
|
||||
si::Interleaf::ERROR_SUCCESS) {
|
||||
SDL_Log("Could not parse SI file %s", p_file);
|
||||
return false;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user