Skip to content

Commit 37721ae

Browse files
committed
fix libflatccrt
1 parent 24789c8 commit 37721ae

File tree

4 files changed

+11
-20
lines changed

4 files changed

+11
-20
lines changed

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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ 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+
set_property(TARGET flatccrt PROPERTY DEBUG_POSTFIX "")
9293
install(
9394
TARGETS flatccrt
94-
DESTINATION ${CMAKE_BINARY_DIR}/lib
95+
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/flatcc/lib
9596
)

tools/cmake/executorch-config.cmake

Lines changed: 4 additions & 8 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
@@ -106,7 +100,9 @@ foreach(lib ${lib_list})
106100
set(lib_var "LIB_${lib}")
107101
find_library(
108102
${lib_var} ${lib}
109-
HINTS "${_root}/lib"
103+
HINTS
104+
"${_root}/lib"
105+
"${_root}/third-party/flatcc/lib"
110106
CMAKE_FIND_ROOT_PATH_BOTH
111107
)
112108
if(NOT ${lib_var})

0 commit comments

Comments
 (0)