Explorar el Código

HPCC-18629 Python cache variables allow dev overwrite

Signed-off-by: Michael Gardner <michael.gardner@lexisnexisrisk.com>
Signed-off-by: Michael Gardner <michael.gardner@lexisnexis.com>
Michael Gardner hace 7 años
padre
commit
e62d7edd86

+ 7 - 7
plugins/py3embed/CMakeLists.txt

@@ -33,13 +33,13 @@ if(PY3EMBED)
     unset(PYTHON_DEBUG_LIBRARIES CACHE)
     unset(PYTHONLIBS_VERSION_STRING CACHE)
     ADD_PLUGIN(py3embed PACKAGES PythonLibs MINVERSION 3.3)
-    set(PYTHON3LIBS_FOUND ${PYTHONLIBS_FOUND})
-    set(PYTHON3_LIBRARY ${PYTHON_LIBRARY})
-    set(PYTHON3_LIBRARIES ${PYTHON_LIBRARIES})
-    set(PYTHON3_INCLUDE_PATH ${PYTHON_INCLUDE_PATH})
-    set(PYTHON3_INCLUDE_DIR ${PYTHON_INCLUDE_DIR})
-    set(PYTHON3_DEBUG_LIBRARIES ${PYTHON_DEBUG_LIBRARIES})
-    set(PYTHON3LIBS_VERSION_STRING ${PYTHONLIBS_VERSION_STRING})
+    set(PYTHON3LIBS_FOUND ${PYTHONLIBS_FOUND} CACHE BOOL "Found Python3 Libraries")
+    set(PYTHON3_LIBRARY ${PYTHON_LIBRARY} CACHE PATH "Library")
+    set(PYTHON3_LIBRARIES ${PYTHON_LIBRARIES} CACHE PATH "Libraries")
+    set(PYTHON3_INCLUDE_PATH ${PYTHON_INCLUDE_PATH} CACHE PATH "Include path")
+    set(PYTHON3_INCLUDE_DIR ${PYTHON_INCLUDE_DIR} CACHE PATH "Include dir")
+    set(PYTHON3_DEBUG_LIBRARIES ${PYTHON_DEBUG_LIBRARIES} CACHE PATH "Include Debug Libraries")
+    set(PYTHON3LIBS_VERSION_STRING ${PYTHONLIBS_VERSION_STRING} CACHE STRING "Version")
     message("Python3 library is ${PYTHON3_LIBRARY}")
 
     if(MAKE_PY3EMBED)

+ 1 - 1
plugins/py3embed/py3embed.cpp

@@ -15,7 +15,6 @@
     limitations under the License.
 ############################################################################## */
 
-#include "platform.h"
 
 #ifdef _WIN32
 // There's an issue with Python redefining ssize_t resulting in errors - hide their definition
@@ -26,6 +25,7 @@
 #include "Python.h"
 #endif
 
+#include "platform.h"
 #include "frameobject.h"
 #include "jexcept.hpp"
 #include "jutil.hpp"

+ 7 - 7
plugins/pyembed/CMakeLists.txt

@@ -37,13 +37,13 @@ if(PY2EMBED)
     unset(PYTHON_DEBUG_LIBRARIES CACHE)
     unset(PYTHONLIBS_VERSION_STRING CACHE)
     ADD_PLUGIN(py2embed PACKAGES PythonLibs MINVERSION 2.6 MAXVERSION 2.7)
-    set(PYTHON2LIBS_FOUND ${PYTHONLIBS_FOUND})
-    set(PYTHON2_LIBRARY ${PYTHON_LIBRARY})
-    set(PYTHON2_LIBRARIES ${PYTHON_LIBRARIES})
-    set(PYTHON2_INCLUDE_PATH ${PYTHON_INCLUDE_PATH})
-    set(PYTHON2_INCLUDE_DIR ${PYTHON_INCLUDE_DIR})
-    set(PYTHON2_DEBUG_LIBRARIES ${PYTHON_DEBUG_LIBRARIES})
-    set(PYTHON2LIBS_VERSION_STRING ${PYTHONLIBS_VERSION_STRING})
+    set(PYTHON2LIBS_FOUND ${PYTHONLIBS_FOUND} CACHE BOOL "Found Python2 Libraries")
+    set(PYTHON2_LIBRARY ${PYTHON_LIBRARY} CACHE PATH "Library")
+    set(PYTHON2_LIBRARIES ${PYTHON_LIBRARIES} CACHE PATH "Libraries")
+    set(PYTHON2_INCLUDE_PATH ${PYTHON_INCLUDE_PATH} CACHE PATH "Include path")
+    set(PYTHON2_INCLUDE_DIR ${PYTHON_INCLUDE_DIR} CACHE PATH "Include dir")
+    set(PYTHON2_DEBUG_LIBRARIES ${PYTHON_DEBUG_LIBRARIES} CACHE PATH "Include Debug Libraries")
+    set(PYTHON2LIBS_VERSION_STRING ${PYTHONLIBS_VERSION_STRING} CACHE STRING "Version")
     message("Python2 library is ${PYTHON2_LIBRARY}")
     if(MAKE_PY2EMBED)
         set(

+ 1 - 1
plugins/pyembed/pyembed.cpp

@@ -15,7 +15,6 @@
     limitations under the License.
 ############################################################################## */
 
-#include "platform.h"
 
 #ifdef _WIN32
 // There's an issue with Python redefining ssize_t resulting in errors - hide their definition
@@ -26,6 +25,7 @@
 #include "Python.h"
 #endif
 
+#include "platform.h"
 #include "frameobject.h"
 #include "jexcept.hpp"
 #include "jthread.hpp"