Skip to content

Commit 4b3b4ab

Browse files
committed
fix libflatccrt
1 parent d069d65 commit 4b3b4ab

File tree

10 files changed

+23
-42
lines changed

10 files changed

+23
-42
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ if(EXECUTORCH_BUILD_EXECUTOR_RUNNER)
698698
endif()
699699

700700
if(EXECUTORCH_ENABLE_EVENT_TRACER)
701-
list(APPEND _executor_runner_libs etdump flatccrt)
701+
list(APPEND _executor_runner_libs etdump)
702702
endif()
703703

704704
if(EXECUTORCH_BUILD_COREML)

backends/cadence/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ if(EXECUTORCH_CADENCE_CPU_RUNNER)
6767
extension_data_loader
6868
bundled_program
6969
cadence_ops_lib
70-
flatccrt
7170
)
7271
endif()
7372

devtools/etdump/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ add_library(
4848
target_link_libraries(
4949
etdump
5050
PUBLIC
51-
flatccrt
51+
${FLATCCRT_LIB}
5252
PRIVATE
5353
executorch
5454
)

devtools/etdump/tests/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ et_cxx_test(
2626
EXTRA_LIBS
2727
bundled_program
2828
etdump
29-
flatccrt
3029
)
3130
target_include_directories(
3231
sdk_etdump_tests PRIVATE ${CMAKE_INSTALL_PREFIX}/sdk/include

examples/apple/mps/CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,6 @@ if(NOT CMAKE_TOOLCHAIN_FILE MATCHES ".*(iOS|ios\.toolchain)\.cmake$")
9797
list(TRANSFORM _mps_executor_runner__srcs PREPEND "${EXECUTORCH_ROOT}/")
9898
add_executable(mps_executor_runner ${_mps_executor_runner__srcs})
9999

100-
if(CMAKE_BUILD_TYPE MATCHES "Debug")
101-
set(FLATCC_LIB flatccrt_d)
102-
else()
103-
set(FLATCC_LIB flatccrt)
104-
endif()
105-
106100
if(CMAKE_BUILD_TYPE MATCHES "Debug")
107101
target_link_options(mps_executor_runner PUBLIC -fsanitize=undefined)
108102
endif()
@@ -113,7 +107,6 @@ if(NOT CMAKE_TOOLCHAIN_FILE MATCHES ".*(iOS|ios\.toolchain)\.cmake$")
113107
executorch
114108
gflags
115109
etdump
116-
${FLATCC_LIB}
117110
mpsdelegate
118111
mps_portable_ops_lib
119112
${mps_executor_runner_libs}

examples/arm/executor_runner/CMakeLists.txt

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -576,23 +576,7 @@ 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)
586-
set_property(
587-
TARGET ${FLATCCRT_LIB}
588-
PROPERTY IMPORTED_LOCATION
589-
"${ET_BUILD_DIR_PATH}/lib/lib${FLATCCRT_LIB}.a"
590-
)
591-
592-
list(APPEND arm_executor_runner_link
593-
etdump
594-
${FLATCCRT_LIB}
595-
)
579+
list(APPEND arm_executor_runner_link etdump)
596580
endif()
597581

598582
if(ET_BUNDLE_IO)

examples/devtools/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ target_link_libraries(
6060
etdump
6161
extension_data_loader
6262
bundled_program
63-
flatccrt
6463
portable_ops_lib
6564
portable_kernels
6665
)

examples/qualcomm/executor_runner/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ target_include_directories(
1919
qnn_executor_runner PUBLIC ${_common_include_directories}
2020
)
2121
target_link_libraries(
22-
qnn_executor_runner qnn_executorch_backend full_portable_ops_lib etdump
23-
${FLATCCRT_LIB} gflags
22+
qnn_executor_runner
23+
qnn_executorch_backend
24+
full_portable_ops_lib
25+
etdump
26+
gflags
2427
)
2528
set_target_properties(
2629
qnn_executor_runner PROPERTIES LINK_FLAGS "-Wl,-rpath='$ORIGIN'"

third-party/CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +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-
install(
93-
TARGETS flatccrt
94-
DESTINATION ${CMAKE_BINARY_DIR}/lib
95-
)
92+
# flatcc has a special debug target
93+
if(CMAKE_BUILD_TYPE MATCHES "Release")
94+
set(FLATCCRT_LIB flatccrt CACHE STRING "flatccrt library")
95+
else()
96+
set(FLATCCRT_LIB flatccrt_d CACHE STRING "flatccrt library")
97+
endif()

tools/cmake/executorch-config.cmake

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,11 @@ 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}
7164
coreml_util
7265
coreml_inmemoryfs
7366
coremldelegate
@@ -154,6 +147,15 @@ if(TARGET coremldelegate)
154147
)
155148
endif()
156149

150+
if(TARGET etdump)
151+
if(CMAKE_BUILD_TYPE MATCHES "Release")
152+
set(FLATCCRT_LIB flatccrt)
153+
else()
154+
set(FLATCCRT_LIB flatccrt_d)
155+
endif()
156+
set_target_properties(etdump PROPERTIES INTERFACE_LINK_LIBRARIES "${FLATCCRT_LIB};executorch")
157+
endif()
158+
157159
if(TARGET optimized_native_cpu_ops_lib)
158160
if(TARGET optimized_portable_kernels)
159161
set(_maybe_optimized_portable_kernels_lib optimized_portable_kernels)

0 commit comments

Comments
 (0)