| 6 | # |
| 7 | # https://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 |
| 15 | from __future__ import print_function |
| 16 |
| 17 | import subprocess |
| 18 | import sys |
| 19 |
| 20 | import vs_toolchain |
| 21 |
| 22 | if len(sys.argv) < 2: |
| 23 | print("Usage: vs_env.py TARGET_ARCH CMD...", file=sys.stderr) |
| 24 | sys.exit(1) |
| 25 |
| 26 | target_arch = sys.argv[1] |
| 27 | cmd = sys.argv[2:] |
| 28 |
| 29 | vs_toolchain.SetEnvironmentForCPU(target_arch) |
| 30 | sys.exit(subprocess.call(cmd)) |
| 31 |