Merge branch 'master' into shader_pipeline

This commit is contained in:
Robert Osfield 2018-01-23 12:38:50 +00:00
commit a2eb879965
3 changed files with 19 additions and 6 deletions

View File

@ -480,7 +480,6 @@ OPTION(OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION "Set to ON to use the ref_ptr<
OPTION(OSG_USE_REF_PTR_SAFE_DEREFERENCE "Set to ON to throw an exception whenever ref_ptr<> is dereferenced or called. " OFF) OPTION(OSG_USE_REF_PTR_SAFE_DEREFERENCE "Set to ON to throw an exception whenever ref_ptr<> is dereferenced or called. " OFF)
OPTION(OSG_ENVVAR_SUPPORTED "Set to ON to build OpenSceneGraph with the #define OSG_ENVVAR_SUPPORTED, found in include/osg/Config, to enable use of getenv() related functions." ON) OPTION(OSG_ENVVAR_SUPPORTED "Set to ON to build OpenSceneGraph with the #define OSG_ENVVAR_SUPPORTED, found in include/osg/Config, to enable use of getenv() related functions." ON)
OPTION(OSG_SYSTEM_SUPPORTED "Set to ON to build OpenSceneGraph with the #define OSG_SYSTEM_SUPPORTED, found in include/osg/Config, to enable use of system() related functions." ON)

View File

@ -35,6 +35,5 @@
#cmakedefine OSG_PROVIDE_READFILE #cmakedefine OSG_PROVIDE_READFILE
#cmakedefine OSG_USE_DEPRECATED_API #cmakedefine OSG_USE_DEPRECATED_API
#cmakedefine OSG_ENVVAR_SUPPORTED #cmakedefine OSG_ENVVAR_SUPPORTED
#cmakedefine OSG_SYSTEM_SUPPORTED
#endif #endif

View File

@ -15,14 +15,29 @@
extern "C" { extern "C" {
#define USE_POSIX_SPAWN defined(__APPLE__)
//#define USE_POSIX_SPAWN true
#if USE_POSIX_SPAWN
#include <spawn.h>
#include <sys/wait.h>
int osg_system(const char* command)
{
pid_t pid;
posix_spawn(&pid, command, NULL, NULL, NULL, NULL);
return waitpid(pid, NULL, 0);
}
#else // use tranditional C sysmtem call for osg_system implementation
int osg_system(const char* command) int osg_system(const char* command)
{ {
#ifdef OSG_SYSTEM_SUPPORTED
return system(command); return system(command);
#else }
printf("osg_system(%s) not supported.\n", command);
#endif #endif
}
} }