diff --git a/CMakeLists.txt b/CMakeLists.txt index 231833c809bc..f4a9728ee242 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -430,17 +430,17 @@ if(IREE_ENABLE_THREADING) add_subdirectory(third_party/cpuinfo EXCLUDE_FROM_ALL) endif() -iree_set_flatcc_cmake_options() add_subdirectory(build_tools/third_party/flatcc EXCLUDE_FROM_ALL) -add_subdirectory(third_party/flatcc EXCLUDE_FROM_ALL) add_subdirectory(third_party/vulkan_headers EXCLUDE_FROM_ALL) # TODO(scotttodd): Iterate some more and find a better place for this. if (NOT CMAKE_CROSSCOMPILING) - install(TARGETS iree-flatcc-cli - COMPONENT iree-flatcc-cli - RUNTIME DESTINATION bin) + install( + TARGETS iree-flatcc-cli + COMPONENT iree-flatcc-cli + RUNTIME DESTINATION bin + ) endif() if(IREE_BUILD_COMPILER) diff --git a/build_tools/cmake/iree_third_party_cmake_options.cmake b/build_tools/cmake/iree_third_party_cmake_options.cmake index 2efba4e42db9..37fd9da2508b 100644 --- a/build_tools/cmake/iree_third_party_cmake_options.cmake +++ b/build_tools/cmake/iree_third_party_cmake_options.cmake @@ -17,19 +17,6 @@ macro(iree_set_cpuinfo_cmake_options) set(CPUINFO_BUILD_MOCK_TESTS OFF CACHE BOOL "" FORCE) endmacro() -macro(iree_set_flatcc_cmake_options) - set(FLATCC_TEST OFF CACHE BOOL "" FORCE) - set(FLATCC_CXX_TEST OFF CACHE BOOL "" FORCE) - set(FLATCC_REFLECTION OFF CACHE BOOL "" FORCE) - set(FLATCC_ALLOW_WERROR OFF CACHE BOOL "" FORCE) - - if(CMAKE_CROSSCOMPILING) - set(FLATCC_RTONLY ON CACHE BOOL "" FORCE) - else() - set(FLATCC_RTONLY OFF CACHE BOOL "" FORCE) - endif() -endmacro() - macro(iree_set_googletest_cmake_options) set(INSTALL_GTEST OFF CACHE BOOL "" FORCE) set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) diff --git a/build_tools/third_party/flatcc/CMakeLists.txt b/build_tools/third_party/flatcc/CMakeLists.txt index f707b567f03b..74caf63763c1 100644 --- a/build_tools/third_party/flatcc/CMakeLists.txt +++ b/build_tools/third_party/flatcc/CMakeLists.txt @@ -85,14 +85,35 @@ external_cc_library( if(NOT CMAKE_CROSSCOMPILING) add_executable(iree-flatcc-cli "${FLATCC_ROOT}/src/cli/flatcc_cli.c" + "${FLATCC_ROOT}/external/hash/cmetrohash64.c" + "${FLATCC_ROOT}/external/hash/str_set.c" + "${FLATCC_ROOT}/external/hash/ptr_set.c" + "${FLATCC_ROOT}/src/compiler/hash_tables/symbol_table.c" + "${FLATCC_ROOT}/src/compiler/hash_tables/scope_table.c" + "${FLATCC_ROOT}/src/compiler/hash_tables/name_table.c" + "${FLATCC_ROOT}/src/compiler/hash_tables/schema_table.c" + "${FLATCC_ROOT}/src/compiler/hash_tables/value_set.c" + "${FLATCC_ROOT}/src/compiler/fileio.c" + "${FLATCC_ROOT}/src/compiler/parser.c" + "${FLATCC_ROOT}/src/compiler/semantics.c" + "${FLATCC_ROOT}/src/compiler/coerce.c" + "${FLATCC_ROOT}/src/compiler/codegen_schema.c" + "${FLATCC_ROOT}/src/compiler/flatcc.c" + "${FLATCC_ROOT}/src/compiler/codegen_c.c" + "${FLATCC_ROOT}/src/compiler/codegen_c_reader.c" + "${FLATCC_ROOT}/src/compiler/codegen_c_sort.c" + "${FLATCC_ROOT}/src/compiler/codegen_c_builder.c" + "${FLATCC_ROOT}/src/compiler/codegen_c_verifier.c" + "${FLATCC_ROOT}/src/compiler/codegen_c_sorter.c" + "${FLATCC_ROOT}/src/compiler/codegen_c_json_parser.c" + "${FLATCC_ROOT}/src/compiler/codegen_c_json_printer.c" + "${FLATCC_ROOT}/src/runtime/builder.c" + "${FLATCC_ROOT}/src/runtime/emitter.c" + "${FLATCC_ROOT}/src/runtime/refmap.c" ) - - target_link_libraries(iree-flatcc-cli - flatcc - ) - target_include_directories(iree-flatcc-cli SYSTEM PUBLIC + "${FLATCC_ROOT}/external" "${FLATCC_ROOT}/include" "${FLATCC_ROOT}/config" )