)]}'
{
  "commit": "0d281b7e4823f93c7630d61a3b0784c67622b136",
  "tree": "942b3093e277a60f95c2bce5343191554600c6e6",
  "parents": [
    "99fcd424092658bc9aa4d973d0cc0c6d682427ea"
  ],
  "author": {
    "name": "Lei Zhang",
    "email": "antiagainst@google.com",
    "time": "Mon Jun 01 20:00:23 2020 -0400"
  },
  "committer": {
    "name": "Lei Zhang",
    "email": "antiagainst@google.com",
    "time": "Tue Jun 02 15:01:49 2020 -0400"
  },
  "message": "[cmake] Set up cross compilation for IREE\n\nThis commit adds cross compilation support to IREE\u0027s CMake build\nsystem. This requires a few non-trival changes due to how IREE\nstructures the code.\n\nIn IREE we auto-generate many C++ source code files during build\nprocess. Notably we use flatc to generate FlatBuffer include files\nfrom schemas and tablegen to generate many other compiler source\nfiles. And we even use iree-translate to compile models into IREE\nbinary modules for testing...  These binaries must be first be\ncompiled on the host and then we can later use them to generate\ncode for compiling towards the target architecture.\n\nThis commit adds a iree_cross_compile.cmake file for a bunch of\nutilities for cross-compilation. If cross compilation mode is\ndetected, we invoke CMake another time under another directory\nand feed in the configurations for host to compile the autogen\ntools first. The CMake invocation needs to track and drive the\nhost compilation though; this is mainly done via file dependencies\nand custom commands. For the target compilation, we wire up the\ndependency there.\n\nTested the following command and it worked:\n\n```shell\nmkdir build-android\ncd build-android\ncmake .. \\\n  -DCMAKE_TOOLCHAIN_FILE\u003d$ANDROID_NDK/build/cmake/android.toolchain.cmake \\\n  -DANDROID_ABI\u003d\"arm64-v8a\" -DANDROID_PLATFORM\u003dandroid-24 \\\n  -DIREE_BUILD_SAMPLES\u003dOFF -DIREE_BUILD_COMPILER\u003dOFF \\\n  -DIREE_BUILD_TESTS\u003dOFF -DIREE_HOST_C_COMPILER\u003d`which clang` \\\n  -DIREE_HOST_CXX_COMPILER\u003d`which clang++` -GNinja\nninja\n```\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "04a3ac84d0eafd68bc727734bb97f73b7adc41f8",
      "old_mode": 33188,
      "old_path": "CMakeLists.txt",
      "new_id": "6ae4d17e310e89373e02bd25b1e9e81f07cbcb58",
      "new_mode": 33188,
      "new_path": "CMakeLists.txt"
    },
    {
      "type": "modify",
      "old_id": "6ad2995eede49c73830ea57090739052ae44b02a",
      "old_mode": 33188,
      "old_path": "build_tools/cmake/flatbuffer_cc_library.cmake",
      "new_id": "71219b9c57a4d90432e5ff973bbdf7cc5c77e275",
      "new_mode": 33188,
      "new_path": "build_tools/cmake/flatbuffer_cc_library.cmake"
    },
    {
      "type": "modify",
      "old_id": "dc1d67f2e4cd8e6a5a72194d199dfb8c8cd9f78a",
      "old_mode": 33188,
      "old_path": "build_tools/cmake/iree_bytecode_module.cmake",
      "new_id": "fa79ecfd582937a105839f0d94f61b85fa027bcc",
      "new_mode": 33188,
      "new_path": "build_tools/cmake/iree_bytecode_module.cmake"
    },
    {
      "type": "modify",
      "old_id": "b8e2a8ee5ac89865e55b27fef855388d5929006e",
      "old_mode": 33188,
      "old_path": "build_tools/cmake/iree_cc_binary.cmake",
      "new_id": "211b8098bcb2aefe30420ea2f44bf24ce938bade",
      "new_mode": 33188,
      "new_path": "build_tools/cmake/iree_cc_binary.cmake"
    },
    {
      "type": "modify",
      "old_id": "d3644edabbd3da7ae07867c3c578800c481df003",
      "old_mode": 33188,
      "old_path": "build_tools/cmake/iree_cc_embed_data.cmake",
      "new_id": "7852dc59e4c8cf07ea24323990c8912b1cfbce45",
      "new_mode": 33188,
      "new_path": "build_tools/cmake/iree_cc_embed_data.cmake"
    },
    {
      "type": "modify",
      "old_id": "29eac45246db25dd52e2b2507c0eb533042ba487",
      "old_mode": 33188,
      "old_path": "build_tools/cmake/iree_copts.cmake",
      "new_id": "fbc40e75acfe61b88047ac052e03522aa99935d4",
      "new_mode": 33188,
      "new_path": "build_tools/cmake/iree_copts.cmake"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "40f33248f80e6486a7bad758324595ceadca0e94",
      "new_mode": 33188,
      "new_path": "build_tools/cmake/iree_cross_compile.cmake"
    },
    {
      "type": "modify",
      "old_id": "ec079348b493a0650718a049e350caf6c580c6c3",
      "old_mode": 33188,
      "old_path": "build_tools/embed_data/CMakeLists.txt",
      "new_id": "3f9410e9e370603924eacb0ffec2cd32a2f1fca9",
      "new_mode": 33188,
      "new_path": "build_tools/embed_data/CMakeLists.txt"
    },
    {
      "type": "modify",
      "old_id": "866053218886d554dd821f9e1f69515e5adeb476",
      "old_mode": 33188,
      "old_path": "iree/tools/CMakeLists.txt",
      "new_id": "00c9c6e37cdcc51377989518340e6f4938425758",
      "new_mode": 33188,
      "new_path": "iree/tools/CMakeLists.txt"
    }
  ]
}
