OLD | NEW |
(Empty) | |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 { |
| 6 'includes': [ |
| 7 '../native_client/build/untrusted.gypi', |
| 8 ], |
| 9 'targets': [ |
| 10 { |
| 11 'target_name': 'nacl_test_common', |
| 12 'type': 'none', |
| 13 'dependencies': [ |
| 14 '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:nacl_lib', |
| 15 '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib', |
| 16 '<(DEPTH)/ppapi/ppapi_untrusted.gyp:ppapi_cpp_lib', |
| 17 ], |
| 18 'direct_dependent_settings': { |
| 19 # We need to override the variables in untrusted.gypi outside of a |
| 20 # target_condition block because the target_condition block in |
| 21 # untrusted gypi is fully evaluated and interpolated before any of the |
| 22 # target_condition blocks in this file are expanded. This means that |
| 23 # any variables overriden inside a target_condition block in this file |
| 24 # will not affect the values in untrusted.gypi. |
| 25 'variables': { |
| 26 'test_files': [], |
| 27 'nacl_newlib_out_dir': '<(PRODUCT_DIR)/>(nexe_destination_dir)/newlib'
, |
| 28 'nacl_glibc_out_dir': '<(PRODUCT_DIR)/>(nexe_destination_dir)/glibc', |
| 29 'nacl_pnacl_newlib_out_dir': '<(PRODUCT_DIR)/>(nexe_destination_dir)/p
nacl', |
| 30 'target_conditions': [ |
| 31 ['nexe_target!=""', { |
| 32 # Patch over the fact that untrusted.gypi doesn't define these in |
| 33 # all cases. |
| 34 'enable_x86_64%': 0, |
| 35 'enable_x86_32%': 0, |
| 36 'enable_arm%': 0, |
| 37 'link_flags': [ |
| 38 '-lppapi_cpp', |
| 39 '-lppapi', |
| 40 '-pthread', |
| 41 ], |
| 42 'extra_args': [ |
| 43 '--strip-all', |
| 44 ], |
| 45 # These variables are used for nexe building and for library |
| 46 # building, so they should be unconditionally re-defined. |
| 47 'out_newlib32': '>(nacl_newlib_out_dir)/>(nexe_target)_newlib_x86_
32.nexe', |
| 48 'out_newlib64': '>(nacl_newlib_out_dir)/>(nexe_target)_newlib_x86_
64.nexe', |
| 49 'out_newlib_arm': '>(nacl_newlib_out_dir)/>(nexe_target)_newlib_ar
m.nexe', |
| 50 'nmf_newlib': '>(nacl_newlib_out_dir)/>(nexe_target).nmf', |
| 51 'out_glibc32': '>(nacl_glibc_out_dir)/>(nexe_target)_glibc_x86_32.
nexe', |
| 52 'out_glibc64': '>(nacl_glibc_out_dir)/>(nexe_target)_glibc_x86_64.
nexe', |
| 53 'out_glibc_arm': '>(nacl_glibc_out_dir)/>(nexe_target)_glibc_arm.n
exe', |
| 54 'nmf_glibc': '>(nacl_glibc_out_dir)/>(nexe_target).nmf', |
| 55 'out_pnacl_newlib': '>(nacl_pnacl_newlib_out_dir)/>(nexe_target)_n
ewlib_pnacl.pexe', |
| 56 'nmf_pnacl_newlib': '>(nacl_pnacl_newlib_out_dir)/>(nexe_target).n
mf', |
| 57 }], |
| 58 ], |
| 59 }, |
| 60 'target_conditions': [ |
| 61 ['test_files!=[] and build_newlib==1', { |
| 62 'copies': [ |
| 63 { |
| 64 'destination': '>(nacl_newlib_out_dir)', |
| 65 'files': [ |
| 66 '>@(test_files)', |
| 67 ], |
| 68 }, |
| 69 ], |
| 70 }], |
| 71 ['test_files!=[] and "<(target_arch)"!="arm" and disable_glibc==0 and
build_glibc==1', { |
| 72 'copies': [ |
| 73 { |
| 74 'destination': '>(nacl_glibc_out_dir)', |
| 75 'files': [ |
| 76 '>@(test_files)', |
| 77 ], |
| 78 }, |
| 79 ], |
| 80 }], |
| 81 ['test_files!=[] and build_pnacl_newlib==1 and disable_pnacl==0', { |
| 82 'copies': [ |
| 83 { |
| 84 'destination': '>(nacl_pnacl_newlib_out_dir)', |
| 85 'files': [ |
| 86 '>@(test_files)', |
| 87 ], |
| 88 }, |
| 89 ], |
| 90 }], |
| 91 ['nexe_target!=""', { |
| 92 'target_conditions': [ |
| 93 ['build_newlib==1', { |
| 94 'actions': [ |
| 95 { |
| 96 'action_name': 'Generate NEWLIB NMF', |
| 97 # Unlike glibc, nexes are not actually inputs - only the |
| 98 # names matter. We don't have the nexes as inputs because |
| 99 # the ARM nexe may not exist. However, VS 2010 seems to |
| 100 # blackhole this entire target if there are no inputs to |
| 101 # this action. To work around this we add a bogus input. |
| 102 'inputs': [], |
| 103 'outputs': ['>(nmf_newlib)'], |
| 104 'action': [ |
| 105 'python', |
| 106 '>(current_depth)/native_client_sdk/src/tools/create_nmf.p
y', |
| 107 '>@(_inputs)', |
| 108 '--output=>(nmf_newlib)', |
| 109 ], |
| 110 'target_conditions': [ |
| 111 ['enable_x86_64==1', { |
| 112 'inputs': ['>(out_newlib64)'], |
| 113 }], |
| 114 ['enable_x86_32==1', { |
| 115 'inputs': ['>(out_newlib32)'], |
| 116 }], |
| 117 ['enable_arm==1', { |
| 118 'inputs': ['>(out_newlib_arm)'], |
| 119 }], |
| 120 ], |
| 121 }, |
| 122 ], |
| 123 }], |
| 124 ['"<(target_arch)"!="arm" and disable_glibc==0 and build_glibc==1'
, { |
| 125 'variables': { |
| 126 # NOTE: Use /lib, not /lib64 here; it is a symbolic link which |
| 127 # doesn't work on Windows. |
| 128 'libdir_glibc64': '>(nacl_glibc_tc_root)/x86_64-nacl/lib', |
| 129 'libdir_glibc32': '>(nacl_glibc_tc_root)/x86_64-nacl/lib32', |
| 130 'nacl_objdump': '>(nacl_glibc_tc_root)/bin/x86_64-nacl-objdump
', |
| 131 }, |
| 132 'actions': [ |
| 133 { |
| 134 'action_name': 'Generate GLIBC NMF and copy libs', |
| 135 'inputs': [], |
| 136 # NOTE: There is no explicit dependency for the lib32 |
| 137 # and lib64 directories created in the PRODUCT_DIR. |
| 138 # They are created as a side-effect of NMF creation. |
| 139 'outputs': ['>(nmf_glibc)'], |
| 140 'action': [ |
| 141 'python', |
| 142 '>(current_depth)/native_client_sdk/src/tools/create_nmf.p
y', |
| 143 '>@(_inputs)', |
| 144 '--objdump=>(nacl_objdump)', |
| 145 '--output=>(nmf_glibc)', |
| 146 '--path-prefix=>(nexe_target)_libs', |
| 147 '--stage-dependencies=<(nacl_glibc_out_dir)', |
| 148 ], |
| 149 'target_conditions': [ |
| 150 ['enable_x86_64==1', { |
| 151 'inputs': ['>(out_glibc64)'], |
| 152 'action': [ |
| 153 '--library-path=>(libdir_glibc64)', |
| 154 '--library-path=<(SHARED_INTERMEDIATE_DIR)/tc_glibc/li
b64', |
| 155 ], |
| 156 }], |
| 157 ['enable_x86_32==1', { |
| 158 'inputs': ['>(out_glibc32)'], |
| 159 'action': [ |
| 160 '--library-path=>(libdir_glibc32)', |
| 161 '--library-path=<(SHARED_INTERMEDIATE_DIR)/tc_glibc/li
b32', |
| 162 ], |
| 163 }], |
| 164 # TODO(ncbray) handle arm case. We don't have ARM glibc |
| 165 # yet. |
| 166 ], |
| 167 }, |
| 168 ], |
| 169 }], |
| 170 ['build_pnacl_newlib==1 and disable_pnacl==0', { |
| 171 'actions': [ |
| 172 { |
| 173 'action_name': 'Generate PNACL NEWLIB NMF', |
| 174 'inputs': ['>(out_pnacl_newlib)'], |
| 175 'outputs': ['>(nmf_pnacl_newlib)'], |
| 176 'action': [ |
| 177 'python', |
| 178 '>(current_depth)/native_client_sdk/src/tools/create_nmf.p
y', |
| 179 '>@(_inputs)', |
| 180 '--output=>(nmf_pnacl_newlib)', |
| 181 ], |
| 182 }, |
| 183 ], |
| 184 }], |
| 185 ], |
| 186 }], |
| 187 ], |
| 188 }, |
| 189 }, |
| 190 ], |
| 191 } |
OLD | NEW |