11320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci// Copyright 2014 The Chromium Authors. All rights reserved.
21320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci// Use of this source code is governed by a BSD-style license that can be
31320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci// found in the LICENSE file.
41320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
51320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#include <iostream>
61320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
71320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#include "mojo/embedder/embedder.h"
81320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#include "mojo/embedder/simple_platform_support.h"
91320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#include "mojo/nacl/monacl_sel_main.h"
101320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
111320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
121320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucciint main(int argc, char* argv[]) {
131320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  if (argc < 3) {
141320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci    std::cout << "Usage: " << argv[0] << " irt.nexe app.nexe [args for app]" <<
151320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci        std::endl;
161320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci    return 1;
171320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  }
181320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
191320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  const char* irt_file = argv[1];
201320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  const char* nexe_file = argv[2];
211320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
221320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  mojo::embedder::Init(scoped_ptr<mojo::embedder::PlatformSupport>(
231320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci      new mojo::embedder::SimplePlatformSupport()));
241320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
251320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  // Does not return.
261320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  mojo::LaunchNaCl(nexe_file, irt_file, argc - 2, argv + 2);
271320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci  return 1;
281320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci}
29