File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -497,7 +497,7 @@ if(EXECUTORCH_BUILD_FLATC)
497
497
# Build flatc for the *host* to generate files as part of the build step.
498
498
include (ExternalProject )
499
499
ExternalProject_Add (
500
- flatc
500
+ flatbuffers
501
501
PREFIX ${CMAKE_CURRENT_BINARY_DIR} /third-party/flatbuffers
502
502
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} /third-party/flatbuffers
503
503
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} /third-party/flatbuffers
@@ -510,8 +510,9 @@ if(EXECUTORCH_BUILD_FLATC)
510
510
-DCMAKE_CXX_FLAGS= "-DFLATBUFFERS_MAX_ALIGNMENT=${FLATBUFFERS_MAX_ALIGNMENT} "
511
511
INSTALL_COMMAND ""
512
512
)
513
- ExternalProject_Get_Property (flatc BINARY_DIR )
513
+ ExternalProject_Get_Property (flatbuffers BINARY_DIR )
514
514
set (FLATC_EXECUTABLE ${BINARY_DIR} /flatc )
515
+ set (FLATC_EXECUTABLE_BUILT_FROM_SOURCE YES )
515
516
endif ()
516
517
517
518
if (NOT FLATC_EXECUTABLE )
@@ -530,6 +531,13 @@ if(NOT FLATC_EXECUTABLE)
530
531
endif ()
531
532
endif ()
532
533
534
+ add_executable (flatc IMPORTED GLOBAL )
535
+ set_target_properties (flatc PROPERTIES IMPORTED_LOCATION ${FLATC_EXECUTABLE} )
536
+
537
+ if (FLATC_EXECUTABLE_BUILT_FROM_SOURCE )
538
+ add_dependencies (flatc flatbuffers )
539
+ endif ()
540
+
533
541
#
534
542
# program_schema: Generated .h files from schema/*.fbs inputs
535
543
#
You can’t perform that action at this time.
0 commit comments