Merge pull request #12175 from abouvier/unbundle-simpleini

cmake: prefer system simpleini library
This commit is contained in:
liamwhite 2023-11-26 09:49:43 -05:00 committed by GitHub
commit c100d7e802
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 25 additions and 2 deletions

View file

@ -290,6 +290,7 @@ find_package(lz4 REQUIRED)
find_package(nlohmann_json 3.8 REQUIRED) find_package(nlohmann_json 3.8 REQUIRED)
find_package(Opus 1.3 MODULE) find_package(Opus 1.3 MODULE)
find_package(RenderDoc MODULE) find_package(RenderDoc MODULE)
find_package(SimpleIni MODULE)
find_package(stb MODULE) find_package(stb MODULE)
find_package(VulkanMemoryAllocator CONFIG) find_package(VulkanMemoryAllocator CONFIG)
find_package(ZLIB 1.2 REQUIRED) find_package(ZLIB 1.2 REQUIRED)

View file

@ -0,0 +1,19 @@
# SPDX-FileCopyrightText: 2023 Alexandre Bouvier <contact@amb.tf>
#
# SPDX-License-Identifier: GPL-3.0-or-later
find_path(SimpleIni_INCLUDE_DIR SimpleIni.h)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SimpleIni
REQUIRED_VARS SimpleIni_INCLUDE_DIR
)
if (SimpleIni_FOUND AND NOT TARGET SimpleIni::SimpleIni)
add_library(SimpleIni::SimpleIni INTERFACE IMPORTED)
set_target_properties(SimpleIni::SimpleIni PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${SimpleIni_INCLUDE_DIR}"
)
endif()
mark_as_advanced(SimpleIni_INCLUDE_DIR)

View file

@ -292,4 +292,6 @@ if (YUZU_CRASH_DUMPS AND NOT TARGET libbreakpad_client)
endif() endif()
# SimpleIni # SimpleIni
if (NOT TARGET SimpleIni::SimpleIni)
add_subdirectory(simpleini) add_subdirectory(simpleini)
endif()

View file

@ -7,4 +7,4 @@ add_library(frontend_common STATIC
) )
create_target_directory_groups(frontend_common) create_target_directory_groups(frontend_common)
target_link_libraries(frontend_common PUBLIC core SimpleIni PRIVATE common Boost::headers) target_link_libraries(frontend_common PUBLIC core SimpleIni::SimpleIni PRIVATE common Boost::headers)

View file

@ -7,6 +7,7 @@
#include <string> #include <string>
#include "common/settings.h" #include "common/settings.h"
#define SI_NO_CONVERSION
#include <SimpleIni.h> #include <SimpleIni.h>
#include <boost/algorithm/string/replace.hpp> #include <boost/algorithm/string/replace.hpp>