gentoo-overlay/games-action/mcpelauncher-linux/files/system-nlohmann_json.patch

40 lines
1.4 KiB
Diff
Raw Permalink Normal View History

2023-03-21 15:52:55 -04:00
diff --git a/ext/json.cmake b/ext/json.cmake
index 9824519..35fa61f 100644
--- a/ext/json.cmake
+++ b/ext/json.cmake
@@ -1,15 +1,20 @@
-include(FetchContent)
+if(USE_EXTERNAL_JSON)
+ add_library(nlohmann_json INTERFACE IMPORTED)
+ Set_property(TARGET nlohmann_json PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${JSON_SOURCES}/include")
+else()
+ include(FetchContent)
+
+ FetchContent_Declare(
+ nlohmann_json_ext
+ URL "https://github.com/nlohmann/json/releases/download/v3.7.3/include.zip"
+ )
+
+ FetchContent_GetProperties(nlohmann_json_ext)
+ if(NOT nlohmann_json_ext_POPULATED)
+ FetchContent_Populate(nlohmann_json_ext)
+ endif()
-FetchContent_Declare(
- nlohmann_json_ext
- URL "https://github.com/nlohmann/json/releases/download/v3.7.3/include.zip"
-)
-
-FetchContent_GetProperties(nlohmann_json_ext)
-if(NOT nlohmann_json_ext_POPULATED)
- FetchContent_Populate(nlohmann_json_ext)
+ Add_library(nlohmann_json INTERFACE IMPORTED)
+ Add_dependencies(nlohmann_json nlohmann_json_ext)
+ Set_property(TARGET nlohmann_json PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${nlohmann_json_ext_SOURCE_DIR}/include")
endif()
-
-add_library(nlohmann_json INTERFACE IMPORTED)
-add_dependencies(nlohmann_json nlohmann_json_ext)
-set_property(TARGET nlohmann_json PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${nlohmann_json_ext_SOURCE_DIR}/include")
\ No newline at end of file