Merge pull request #30199 from IlsooByun/cmake_ptyhon_var

build/ops: fix build fail related to PYTHON_EXECUTABLE variable

Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2019-09-09 00:02:20 +08:00 committed by GitHub
commit 9e7ecf708a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -316,7 +316,7 @@
/* Define if endian type is little endian */
#cmakedefine CEPH_LITTLE_ENDIAN
#cmakedefine PYTHON_EXECUTABLE "@MGR_PYTHON_EXECUTABLE@"
#cmakedefine MGR_PYTHON_EXECUTABLE "@MGR_PYTHON_EXECUTABLE@"
/* Define to 1 if you have the `getprogname' function. */
#cmakedefine HAVE_GETPROGNAME 1

View File

@ -41,10 +41,10 @@ void PyModuleRegistry::init()
// Set up global python interpreter
#if PY_MAJOR_VERSION >= 3
#define WCHAR(s) L ## #s
Py_SetProgramName(const_cast<wchar_t*>(WCHAR(PYTHON_EXECUTABLE)));
Py_SetProgramName(const_cast<wchar_t*>(WCHAR(MGR_PYTHON_EXECUTABLE)));
#undef WCHAR
#else
Py_SetProgramName(const_cast<char*>(PYTHON_EXECUTABLE));
Py_SetProgramName(const_cast<char*>(MGR_PYTHON_EXECUTABLE));
#endif
// Add more modules
if (g_conf().get_val<bool>("daemonize")) {