diff options
Diffstat (limited to 'games-util/dfhack/files/dfhack-0.44.12.2_p20190721/03-respect-0.patch')
-rw-r--r-- | games-util/dfhack/files/dfhack-0.44.12.2_p20190721/03-respect-0.patch | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/games-util/dfhack/files/dfhack-0.44.12.2_p20190721/03-respect-0.patch b/games-util/dfhack/files/dfhack-0.44.12.2_p20190721/03-respect-0.patch new file mode 100644 index 0000000..76c504a --- /dev/null +++ b/games-util/dfhack/files/dfhack-0.44.12.2_p20190721/03-respect-0.patch @@ -0,0 +1,64 @@ +respect DFHACK_PLUGIN_DESTINATION + +From: eroen <dfhack@occam.eroen.eu> + + +--- + CMakeLists.txt | 2 +- + library/CMakeLists.txt | 4 +++- + library/PluginManager.cpp | 7 ++++++- + 3 files changed, 10 insertions(+), 3 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 73ab31e5..4c4d5568 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -199,7 +199,7 @@ SET(DFHACK_BINARY_DESTINATION .) + # dfhack data goes here: + SET(DFHACK_DATA_DESTINATION hack CACHE INTERNAL "") + # plugin libs go here: +-SET(DFHACK_PLUGIN_DESTINATION hack/plugins) ++SET(DFHACK_PLUGIN_DESTINATION hack/plugins CACHE INTERNAL "") + # dfhack header files go here: + SET(DFHACK_INCLUDES_DESTINATION hack/include) + # dfhack lua files go here: +diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt +index 9e7c9ce6..151e6e3d 100644 +--- a/library/CMakeLists.txt ++++ b/library/CMakeLists.txt +@@ -80,7 +80,9 @@ RemoteTools.cpp + ) + + set_property( SOURCE "Core.cpp" APPEND PROPERTY COMPILE_DEFINITIONS +- "DFHACK_DATA_DESTINATION=\"${DFHACK_DATA_DESTINATION}\"") ++ "DFHACK_DATA_DESTINATION=\"${DFHACK_DATA_DESTINATION}\"" ) ++set_property( SOURCE "PluginManager.cpp" APPEND PROPERTY COMPILE_DEFINITIONS ++ "DFHACK_PLUGIN_DESTINATION=\"${DFHACK_PLUGIN_DESTINATION}\"" ) + + SET(MAIN_SOURCES_WINDOWS + Console-windows.cpp +diff --git a/library/PluginManager.cpp b/library/PluginManager.cpp +index b17f8e21..ab26b5bf 100644 +--- a/library/PluginManager.cpp ++++ b/library/PluginManager.cpp +@@ -51,6 +51,7 @@ using namespace std; + #include "tinythread.h" + + #include <assert.h> ++#include <string.h> + + #define MUTEX_GUARD(lock) auto lock_##__LINE__ = make_mutex_guard(lock); + template <typename T> +@@ -69,7 +70,11 @@ tthread::lock_guard<T> make_mutex_guard (T *mutex) + + static string getPluginPath() + { +- return Core::getInstance().getHackPath() + "plugins/"; ++ if(strncmp(DFHACK_PLUGIN_DESTINATION, "hack/plugins", 13) == 0) ++ // This is the default value ++ return Core::getInstance().getHackPath() + "plugins/"; ++ else ++ return DFHACK_PLUGIN_DESTINATION "/"; + } + + static string getPluginPath (std::string name) |