Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 0 additions & 13 deletions build_tools/cmake/iree_third_party_cmake_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
31 changes: 26 additions & 5 deletions build_tools/third_party/flatcc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down