Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/creator')
-rw-r--r--source/creator/CMakeLists.txt17
-rw-r--r--source/creator/creator.c63
2 files changed, 55 insertions, 25 deletions
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index aed2a9350bb..8784d9f1744 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -694,6 +694,23 @@ elseif(WIN32)
)
endif()
+ if(WITH_GMP)
+ install(
+ FILES ${LIBDIR}/gmp/lib/libgmp-10.dll
+ DESTINATION "."
+ )
+ install(
+ FILES ${LIBDIR}/gmp/lib/libgmpxx.dll
+ DESTINATION "."
+ CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel
+ )
+ install(
+ FILES ${LIBDIR}/gmp/lib/libgmpxx_d.dll
+ DESTINATION "."
+ CONFIGURATIONS Debug
+ )
+ endif()
+
if(WITH_WINDOWS_PDB)
if(WITH_WINDOWS_STRIPPED_PDB)
# Icky hack for older cmake from https://stackoverflow.com/a/21198501
diff --git a/source/creator/creator.c b/source/creator/creator.c
index 9268ed15923..3d76d832d9f 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -110,25 +110,10 @@
#include "creator_intern.h" /* own include */
/* Local Function prototypes. */
-#ifdef WITH_PYTHON_MODULE
-int main_python_enter(int argc, const char **argv);
-void main_python_exit(void);
-#endif
-#ifdef WITH_USD
-/**
- * Workaround to make it possible to pass a path at runtime to USD.
- *
- * USD requires some JSON files, and it uses a static constructor to determine the possible
- * file-system paths to find those files. This made it impossible for Blender to pass a path to the
- * USD library at runtime, as the constructor would run before Blender's main() function. We have
- * patched USD (see usd.diff) to avoid that particular static constructor, and have an
- * initialization function instead.
- *
- * This function is implemented in the USD source code, `pxr/base/lib/plug/initConfig.cpp`.
- */
-void usd_initialise_plugin_path(const char *datafiles_usd_path);
-#endif
+/* -------------------------------------------------------------------- */
+/** \name Local Application State
+ * \{ */
/* written to by 'creator_args.c' */
struct ApplicationState app_state = {
@@ -143,6 +128,8 @@ struct ApplicationState app_state = {
},
};
+/** \} */
+
/* -------------------------------------------------------------------- */
/** \name Application Level Callbacks
*
@@ -199,11 +186,19 @@ static void callback_clg_fatal(void *fp)
/** \} */
/* -------------------------------------------------------------------- */
-/** \name Main Function
+/** \name Blender as a Stand-Alone Python Module (bpy)
+ *
+ * While not officially supported, this can be useful for Python developers.
+ * See: https://wiki.blender.org/wiki/Building_Blender/Other/BlenderAsPyModule
* \{ */
#ifdef WITH_PYTHON_MODULE
-/* allow python module to call main */
+
+/* Called in `bpy_interface.c` when building as a Python module. */
+int main_python_enter(int argc, const char **argv);
+void main_python_exit(void);
+
+/* Rename the 'main' function, allowing Python initialization to call it. */
# define main main_python_enter
static void *evil_C = NULL;
@@ -211,8 +206,15 @@ static void *evil_C = NULL;
/* Environment is not available in macOS shared libraries. */
# include <crt_externs.h>
char **environ = NULL;
-# endif
-#endif
+# endif /* __APPLE__ */
+
+#endif /* WITH_PYTHON_MODULE */
+
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Main Function
+ * \{ */
/**
* Blender's main function responsibilities are:
@@ -295,7 +297,7 @@ int main(int argc,
break;
}
}
- MEM_initialize_memleak_detection();
+ MEM_init_memleak_detection();
}
#ifdef BUILD_DATE
@@ -441,10 +443,21 @@ int main(int argc,
BKE_materials_init();
#ifdef WITH_USD
+ /* Workaround to make it possible to pass a path at runtime to USD.
+ *
+ * USD requires some JSON files, and it uses a static constructor to determine the possible
+ * file-system paths to find those files. This made it impossible for Blender to pass a path to
+ * the USD library at runtime, as the constructor would run before Blender's main() function.
+ * We have patched USD (see usd.diff) to avoid that particular static constructor, and have an
+ * initialization function instead.
+ *
+ * This function is implemented in the USD source code, `pxr/base/lib/plug/initConfig.cpp`. */
+ extern void usd_initialise_plugin_path(const char *datafiles_usd_path);
+
/* Tell USD which directory to search for its JSON files. If 'datafiles/usd'
* does not exist, the USD library will not be able to read or write any files. */
usd_initialise_plugin_path(BKE_appdir_folder_id(BLENDER_DATAFILES, "usd"));
-#endif
+#endif /* WITH_USD */
if (G.background == 0) {
#ifndef WITH_PYTHON_MODULE
@@ -488,7 +501,7 @@ int main(int argc,
#ifdef WITH_FREESTYLE
/* Initialize Freestyle. */
- FRS_initialize();
+ FRS_init();
FRS_set_context(C);
#endif