File tree Expand file tree Collapse file tree 4 files changed +24
-10
lines changed
Expand file tree Collapse file tree 4 files changed +24
-10
lines changed Original file line number Diff line number Diff line change @@ -576,16 +576,22 @@ if(EXECUTORCH_ENABLE_EVENT_TRACER)
576576 "${ET_BUILD_DIR_PATH} /lib/libetdump.a"
577577 )
578578
579- add_library (flatccrt STATIC IMPORTED )
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 )
580586 set_property (
581- TARGET flatccrt
587+ TARGET ${FLATCCRT_LIB}
582588 PROPERTY IMPORTED_LOCATION
583- "${ET_BUILD_DIR_PATH} /third-party/flatcc/ lib/libflatccrt .a"
589+ "${ET_BUILD_DIR_PATH} /lib/lib ${FLATCCRT_LIB} .a"
584590 )
585591
586592 list (APPEND arm_executor_runner_link
587593 etdump
588- flatccrt
594+ ${FLATCCRT_LIB}
589595 )
590596endif ()
591597
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ target_include_directories(
2020)
2121target_link_libraries (
2222 qnn_executor_runner qnn_executorch_backend full_portable_ops_lib etdump
23- flatccrt gflags
23+ ${FLATCCRT_LIB} gflags
2424)
2525set_target_properties (
2626 qnn_executor_runner PROPERTIES LINK_FLAGS "-Wl,-rpath='$ORIGIN'"
Original file line number Diff line number Diff line change @@ -83,16 +83,18 @@ set(FLATCC_REFLECTION OFF CACHE BOOL "")
8383set (FLATCC_DEBUG_CLANG_SANITIZE OFF CACHE BOOL "" )
8484set (FLATCC_INSTALL OFF CACHE BOOL "" )
8585add_subdirectory (flatcc)
86+ if (CMAKE_BUILD_TYPE MATCHES "Debug" )
87+ set (FLATCCRT_LIB flatccrt_d)
88+ else ()
89+ set (FLATCCRT_LIB flatccrt)
90+ endif ()
8691# Fix for "relocation R_X86_64_32 against `.rodata' can not be used when making
8792# a shared object; recompile with -fPIC" when building on some x86 linux
8893# systems.
8994#
9095# Learn more: https://github.com/pytorch/executorch/pull/2467
9196set_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 "" )
9597install (
96- TARGETS flatccrt
98+ TARGETS ${FLATCCRT_LIB}
9799 DESTINATION ${CMAKE_BINARY_DIR} /lib
98100)
Original file line number Diff line number Diff line change @@ -56,12 +56,18 @@ set(EXECUTORCH_FOUND ON)
5656
5757target_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+
5965set (lib_list
6066 etdump
6167 bundled_program
6268 extension_data_loader
6369 extension_flat_tensor
64- flatccrt
70+ ${FLATCCRT_LIB}
6571 coreml_util
6672 coreml_inmemoryfs
6773 coremldelegate
You can’t perform that action at this time.
0 commit comments