Skip to content

Commit fb6ae9e

Browse files
committed
fix libflatccrt
1 parent 24789c8 commit fb6ae9e

File tree

5 files changed

+25
-34
lines changed

5 files changed

+25
-34
lines changed

CMakeLists.txt

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -455,22 +455,6 @@ if(EXECUTORCH_BUILD_GFLAGS)
455455
add_subdirectory(third-party/gflags)
456456
endif()
457457

458-
# Install `executorch` library as well as `executorch-config.cmake` under
459-
# ${CMAKE_INSTALL_PREFIX}/
460-
install(DIRECTORY runtime/core/ DESTINATION include/executorch/runtime/core FILES_MATCHING PATTERN "*.h")
461-
install(DIRECTORY runtime/kernel/ DESTINATION include/executorch/runtime/kernel FILES_MATCHING PATTERN "*.h")
462-
install(DIRECTORY runtime/platform/ DESTINATION include/executorch/runtime/platform FILES_MATCHING PATTERN "*.h")
463-
install(DIRECTORY extension/kernel_util/ DESTINATION include/executorch/extension/kernel_util FILES_MATCHING PATTERN "*.h")
464-
install(DIRECTORY extension/tensor/ DESTINATION include/executorch/extension/tensor FILES_MATCHING PATTERN "*.h")
465-
install(DIRECTORY extension/threadpool/ DESTINATION include/executorch/extension/threadpool FILES_MATCHING PATTERN "*.h")
466-
install(
467-
TARGETS executorch executorch_core
468-
DESTINATION lib
469-
INCLUDES
470-
DESTINATION ${_common_include_directories}
471-
)
472-
install(FILES tools/cmake/executorch-config.cmake DESTINATION lib/cmake/ExecuTorch)
473-
474458
# Add googletest if any test targets should be built
475459
if(BUILD_TESTING)
476460
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third-party/googletest)
@@ -724,3 +708,19 @@ if(EXECUTORCH_BUILD_VULKAN)
724708
endif()
725709

726710
include(Test.cmake)
711+
712+
# Install `executorch` library as well as `executorch-config.cmake` under
713+
# ${CMAKE_INSTALL_PREFIX}/
714+
install(DIRECTORY runtime/core/ DESTINATION include/executorch/runtime/core FILES_MATCHING PATTERN "*.h")
715+
install(DIRECTORY runtime/kernel/ DESTINATION include/executorch/runtime/kernel FILES_MATCHING PATTERN "*.h")
716+
install(DIRECTORY runtime/platform/ DESTINATION include/executorch/runtime/platform FILES_MATCHING PATTERN "*.h")
717+
install(DIRECTORY extension/kernel_util/ DESTINATION include/executorch/extension/kernel_util FILES_MATCHING PATTERN "*.h")
718+
install(DIRECTORY extension/tensor/ DESTINATION include/executorch/extension/tensor FILES_MATCHING PATTERN "*.h")
719+
install(DIRECTORY extension/threadpool/ DESTINATION include/executorch/extension/threadpool FILES_MATCHING PATTERN "*.h")
720+
install(
721+
TARGETS executorch executorch_core
722+
DESTINATION lib
723+
INCLUDES
724+
DESTINATION ${_common_include_directories}
725+
)
726+
install(FILES tools/cmake/executorch-config.cmake DESTINATION lib/cmake/ExecuTorch)

examples/arm/executor_runner/CMakeLists.txt

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -576,22 +576,16 @@ if(EXECUTORCH_ENABLE_EVENT_TRACER)
576576
"${ET_BUILD_DIR_PATH}/lib/libetdump.a"
577577
)
578578

579-
if(CMAKE_BUILD_TYPE MATCHES "Debug")
580-
set(FLATCCRT_LIB flatccrt_d)
581-
else()
582-
set(FLATCCRT_LIB flatccrt)
583-
endif()
584-
585-
add_library(${FLATCCRT_LIB} STATIC IMPORTED)
579+
add_library(flatccrt STATIC IMPORTED)
586580
set_property(
587-
TARGET ${FLATCCRT_LIB}
581+
TARGET flatccrt
588582
PROPERTY IMPORTED_LOCATION
589-
"${ET_BUILD_DIR_PATH}/lib/lib${FLATCCRT_LIB}.a"
583+
"${ET_BUILD_DIR_PATH}/third-party/flatcc/lib/libflatccrt.a"
590584
)
591585

592586
list(APPEND arm_executor_runner_link
593587
etdump
594-
${FLATCCRT_LIB}
588+
flatccrt
595589
)
596590
endif()
597591

examples/qualcomm/executor_runner/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ target_include_directories(
2020
)
2121
target_link_libraries(
2222
qnn_executor_runner qnn_executorch_backend full_portable_ops_lib etdump
23-
${FLATCCRT_LIB} gflags
23+
flatccrt gflags
2424
)
2525
set_target_properties(
2626
qnn_executor_runner PROPERTIES LINK_FLAGS "-Wl,-rpath='$ORIGIN'"

third-party/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ add_subdirectory(flatcc)
8989
#
9090
# Learn more: https://github.com/pytorch/executorch/pull/2467
9191
set_property(TARGET flatccrt PROPERTY POSITION_INDEPENDENT_CODE ON)
92+
# flatcc appends a "_d" (flatccrt_d) on debug builds. To simplify the build system
93+
# just force the same name for both builds.
94+
set_property(TARGET flatccrt PROPERTY DEBUG_POSTFIX "")
9295
install(
9396
TARGETS flatccrt
9497
DESTINATION ${CMAKE_BINARY_DIR}/lib

tools/cmake/executorch-config.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,12 @@ set(EXECUTORCH_FOUND ON)
5656

5757
target_link_libraries(executorch INTERFACE executorch_core)
5858

59-
if(CMAKE_BUILD_TYPE MATCHES "Debug")
60-
set(FLATCCRT_LIB flatccrt_d)
61-
else()
62-
set(FLATCCRT_LIB flatccrt)
63-
endif()
64-
6559
set(lib_list
6660
etdump
6761
bundled_program
6862
extension_data_loader
6963
extension_flat_tensor
70-
${FLATCCRT_LIB}
64+
flatccrt
7165
coreml_util
7266
coreml_inmemoryfs
7367
coremldelegate

0 commit comments

Comments
 (0)