Hi Robert,
yes, that makes sense. So here's how we can check that we are building for iOS 
(device or simulator):


Code:
#include <osg/os_utils>

#if defined(__APPLE__)
    #include "TargetConditionals.h"
    #if (TARGET_OS_IPHONE)
        #define OSG_SYSTEM_NOT_SUPPORTED
    #endif
#endif

#ifdef OSG_SYSTEM_NOT_SUPPORTED
#include <spawn.h>
#endif

extern "C" {
    
    int osg_system(const char* command)
    {
#ifdef OSG_SYSTEM_NOT_SUPPORTED
        pid_t pid;
        posix_spawn(&pid, command, NULL, NULL, NULL, NULL);
        return waitpid(pid, NULL, 0);
#else
        return system(command);
#endif
    }
    
}




If this is OK I will also remove the OSG_SYSTEM_SUPPORTED option in CMake and 
send all the updated files here. Just let me know.

Cheers,
Alessandro

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72833#72833





_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to