OLD | NEW |
(Empty) | |
| 1 # -*- python -*- |
| 2 # Copyright 2011 The Native Client Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can |
| 4 # be found in the LICENSE file. |
| 5 |
| 6 # A way to build the nexe as a trusted plugin to validate directly |
| 7 # against Chrome on Linux and OS X using |
| 8 # --register-pepper-plugins="/path/to/libppapi_messaging.so;application/x-nacl" |
| 9 # http://localhost:5103/scons-out/nacl-x86-../staging/ppapi_messaging.html |
| 10 # Note that a trusted plugin is not built on Windows. |
| 11 |
| 12 Import('env') |
| 13 |
| 14 plugin_env = env.Clone() |
| 15 |
| 16 sources = ['ppapi_messaging.c'] |
| 17 |
| 18 libs = ['imc', |
| 19 'gio', |
| 20 'pthread', |
| 21 'platform' |
| 22 ] |
| 23 |
| 24 trusted_plugin = None |
| 25 if plugin_env.Bit('linux'): # linux, arm |
| 26 trusted_plugin = plugin_env.DualLibrary('ppapi_messaging', |
| 27 sources) |
| 28 elif plugin_env.Bit('mac'): # os x |
| 29 plugin_env.Append( |
| 30 FRAMEWORKS = ['Cocoa'], |
| 31 LINKFLAGS = ['-bundle', '-framework', 'Foundation'] |
| 32 ) |
| 33 plugin_env['tools'] = 'target_platform_mac' |
| 34 REZ = '/Developer/Tools/Rez' |
| 35 plugin_env.Command(target='ppapi_messaging.rsrc', |
| 36 source='ppapi_messaging.r', |
| 37 action=[Action(REZ + ' -o ${TARGET} ${SOURCE} -useDF')]) |
| 38 ppapi_messaging = plugin_env.ComponentProgram('ppapi_messaging', |
| 39 sources, |
| 40 EXTRA_LIBS=libs, |
| 41 no_import_lib=True) |
| 42 bundle_name = '${STAGING_DIR}/ppapi_messaging.bundle' |
| 43 plugin_env.Alias('ppapi_messaging.bundle', [bundle_name]) |
| 44 plugin_env.Bundle(bundle_name, |
| 45 BUNDLE_EXE=ppapi_messaging, |
| 46 BUNDLE_PKGINFO_FILENAME=0, |
| 47 BUNDLE_RESOURCES='ppapi_messaging.rsrc', |
| 48 BUNDLE_INFO_PLIST='Info.plist') |
| 49 trusted_plugin = bundle_name |
| 50 |
| 51 if not trusted_plugin == None: |
| 52 # Note that the html is required to run this program. |
| 53 nacltest_js = '${SCONSTRUCT_DIR}/tools/browser_tester/browserdata/nacltest.js' |
| 54 dest_copy = plugin_env.Replicate('$STAGING_DIR', |
| 55 ['ppapi_messaging.html', |
| 56 'ppapi_messaging.nmf', |
| 57 env.File(nacltest_js)] |
| 58 ) |
| 59 plugin_env.Depends(trusted_plugin, dest_copy) |
| 60 |
OLD | NEW |