build python module without binreloc, add dummy argv[0] to initialize bprogname.
This commit is contained in:
@@ -161,6 +161,9 @@ endif()
|
|||||||
|
|
||||||
TEST_SSE_SUPPORT()
|
TEST_SSE_SUPPORT()
|
||||||
|
|
||||||
|
# linux only, not cached
|
||||||
|
set(WITH_BINRELOC OFF)
|
||||||
|
|
||||||
# disabled for now, not supported
|
# disabled for now, not supported
|
||||||
# option(WITH_WEBPLUGIN "Enable Web Plugin (Unix only)" OFF)
|
# option(WITH_WEBPLUGIN "Enable Web Plugin (Unix only)" OFF)
|
||||||
|
|
||||||
@@ -346,12 +349,15 @@ if(UNIX AND NOT APPLE)
|
|||||||
set(LLIBS "-lutil -lc -lm -lpthread -lstdc++ ${X11_X11_LIB} ${X11_Xinput_LIB}")
|
set(LLIBS "-lutil -lc -lm -lpthread -lstdc++ ${X11_X11_LIB} ${X11_Xinput_LIB}")
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
# BSD's dont use libdl.so
|
if(NOT WITH_PYTHON_MODULE)
|
||||||
list(APPEND LLIBS -ldl)
|
# BSD's dont use libdl.so
|
||||||
|
list(APPEND LLIBS -ldl)
|
||||||
|
|
||||||
# binreloc is linux only
|
# binreloc is linux only
|
||||||
set(BINRELOC ${CMAKE_SOURCE_DIR}/extern/binreloc)
|
set(BINRELOC ${CMAKE_SOURCE_DIR}/extern/binreloc)
|
||||||
set(BINRELOC_INC ${BINRELOC}/include)
|
set(BINRELOC_INC ${BINRELOC}/include)
|
||||||
|
set(WITH_BINRELOC ON)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(PLATFORM_LINKFLAGS "-pthread")
|
set(PLATFORM_LINKFLAGS "-pthread")
|
||||||
|
2
extern/CMakeLists.txt
vendored
2
extern/CMakeLists.txt
vendored
@@ -31,7 +31,7 @@ if(WITH_BULLET)
|
|||||||
add_subdirectory(bullet2)
|
add_subdirectory(bullet2)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
if(WITH_BINRELOC)
|
||||||
add_subdirectory(binreloc)
|
add_subdirectory(binreloc)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@@ -133,7 +133,8 @@ set(SRC
|
|||||||
intern/dynamiclist.h
|
intern/dynamiclist.h
|
||||||
)
|
)
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
if(WITH_BINRELOC)
|
||||||
|
add_definitions(-DWITH_BINRELOC)
|
||||||
list(APPEND INC "${BINRELOC_INC}")
|
list(APPEND INC "${BINRELOC_INC}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@@ -71,7 +71,7 @@
|
|||||||
|
|
||||||
#else /* non windows */
|
#else /* non windows */
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef WITH_BINRELOC
|
||||||
#include "binreloc.h"
|
#include "binreloc.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1661,7 +1661,7 @@ void BLI_where_am_i(char *fullname, const int maxlen, const char *name)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef WITH_BINRELOC
|
||||||
/* linux uses binreloc since argv[0] is not relyable, call br_init( NULL ) first */
|
/* linux uses binreloc since argv[0] is not relyable, call br_init( NULL ) first */
|
||||||
path = br_find_exe( NULL );
|
path = br_find_exe( NULL );
|
||||||
if (path) {
|
if (path) {
|
||||||
|
@@ -669,6 +669,7 @@ int BPY_context_member_get(bContext *C, const char *member, bContextDataResult *
|
|||||||
|
|
||||||
|
|
||||||
#ifdef WITH_PYTHON_MODULE
|
#ifdef WITH_PYTHON_MODULE
|
||||||
|
#include "BLI_storage.h"
|
||||||
/* TODO, reloading the module isnt functional at the moment. */
|
/* TODO, reloading the module isnt functional at the moment. */
|
||||||
|
|
||||||
extern int main_python(int argc, const char **argv);
|
extern int main_python(int argc, const char **argv);
|
||||||
@@ -687,9 +688,16 @@ static struct PyModuleDef bpy_proxy_def = {
|
|||||||
PyMODINIT_FUNC
|
PyMODINIT_FUNC
|
||||||
PyInit_bpy(void)
|
PyInit_bpy(void)
|
||||||
{
|
{
|
||||||
int argc= 0;
|
int argc= 1;
|
||||||
const char *argv[]={NULL};
|
char *argv[2]={NULL, NULL};
|
||||||
|
|
||||||
|
/* give the CWD as the first arg, blender uses */
|
||||||
|
char path[240]= "";
|
||||||
|
BLI_getwdN(path, sizeof(path));
|
||||||
|
BLI_join_dirfile(path, sizeof(path), path, "bpy");
|
||||||
|
argv[0]= path;
|
||||||
|
/* done with cwd */
|
||||||
|
|
||||||
main_python(argc, argv);
|
main_python(argc, argv);
|
||||||
|
|
||||||
/* initialized in BPy_init_modules() */
|
/* initialized in BPy_init_modules() */
|
||||||
|
@@ -33,7 +33,7 @@ if(WITH_CODEC_QUICKTIME)
|
|||||||
add_definitions(-DWITH_QUICKTIME)
|
add_definitions(-DWITH_QUICKTIME)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
if(WITH_BINRELOC)
|
||||||
add_definitions(-DWITH_BINRELOC)
|
add_definitions(-DWITH_BINRELOC)
|
||||||
blender_include_dirs(${BINRELOC_INC})
|
blender_include_dirs(${BINRELOC_INC})
|
||||||
endif()
|
endif()
|
||||||
|
@@ -90,7 +90,7 @@ if(NOT WITH_SDL)
|
|||||||
add_definitions(-DDISABLE_SDL)
|
add_definitions(-DDISABLE_SDL)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
if(WITH_BINRELOC)
|
||||||
add_definitions(-DWITH_BINRELOC)
|
add_definitions(-DWITH_BINRELOC)
|
||||||
blender_include_dirs(${BINRELOC_INC})
|
blender_include_dirs(${BINRELOC_INC})
|
||||||
endif()
|
endif()
|
||||||
@@ -592,7 +592,7 @@ endif()
|
|||||||
bf_intern_mikktspace
|
bf_intern_mikktspace
|
||||||
)
|
)
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
if(WITH_BINRELOC)
|
||||||
list(APPEND BLENDER_SORTED_LIBS extern_binreloc)
|
list(APPEND BLENDER_SORTED_LIBS extern_binreloc)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user