sys: Make sure libromfs is never used in libimhex

This commit is contained in:
WerWolv
2022-12-05 15:29:19 +01:00
parent 94723dbba3
commit e3f2541fde
6 changed files with 26 additions and 16 deletions

View File

@@ -17,6 +17,11 @@ add_executable(main ${APPLICATION_TYPE}
target_include_directories(main PUBLIC include)
setupCompilerWarnings(main)
set(LIBROMFS_RESOURCE_LOCATION ${IMHEX_BASE_FOLDER}/resources/romfs)
set(LIBROMFS_PROJECT_NAME imhex)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../lib/external/libromfs ${CMAKE_CURRENT_BINARY_DIR}/main/libromfs EXCLUDE_FROM_ALL)
set_target_properties(${LIBROMFS_LIBRARY} PROPERTIES POSITION_INDEPENDENT_CODE ON)
set_target_properties(main PROPERTIES
OUTPUT_NAME "imhex"
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/..

View File

@@ -89,7 +89,6 @@ namespace hex::init {
}
bool WindowSplash::loop() {
hex::log::debug("Using romfs: '{}'", romfs::name());
auto splash = romfs::get("splash.png");
ImGui::Texture splashTexture = ImGui::Texture(reinterpret_cast<const ImU8 *>(splash.data()), splash.size());

View File

@@ -2,6 +2,7 @@
#include <imgui.h>
#include <imgui_freetype.h>
#include <romfs/romfs.hpp>
#include <hex/api/content_registry.hpp>
#include <hex/api/project_file_manager.hpp>
@@ -49,6 +50,14 @@ namespace hex::init {
return true;
}
bool setupEnvironment() {
hex::log::debug("Using romfs: '{}'", romfs::name());
Net::setCACert(std::string(romfs::get("cacert.pem").string()));
return true;
}
bool createDirectories() {
bool result = true;
@@ -327,6 +336,7 @@ namespace hex::init {
std::vector<Task> getInitTasks() {
return {
{ "Setting up environment", setupEnvironment, false },
{ "Creating directories", createDirectories, false },
{ "Loading settings", loadSettings, false },
{ "Loading plugins", loadPlugins, false },