Skip to content

Commit f6f5796

Browse files
authored
Prefix target_link_options_shared_lib with executorch_ (#12667)
I think we are getting build failures in the following PR (e.g., in QNN) because tokenizers has a copy/paste of this function that I changed to work differently. If this works out, we should namespace all our functions.
1 parent 5fe67c3 commit f6f5796

File tree

26 files changed

+79
-79
lines changed

26 files changed

+79
-79
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ target_link_libraries(executorch PRIVATE executorch_core)
416416
target_include_directories(executorch PUBLIC ${_common_include_directories})
417417
target_compile_definitions(executorch PUBLIC C10_USING_CUSTOM_GENERATED_MACROS)
418418
target_compile_options(executorch PUBLIC ${_common_compile_options})
419-
target_link_options_shared_lib(executorch)
419+
executorch_target_link_options_shared_lib(executorch)
420420

421421
#
422422
# portable_ops_lib: A library to register core ATen ops using portable kernels,
@@ -690,7 +690,7 @@ endif()
690690

691691
if(EXECUTORCH_BUILD_KERNELS_QUANTIZED)
692692
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/kernels/quantized)
693-
target_link_options_shared_lib(quantized_ops_lib)
693+
executorch_target_link_options_shared_lib(quantized_ops_lib)
694694
endif()
695695

696696
if(EXECUTORCH_BUILD_EXECUTOR_RUNNER)

backends/apple/coreml/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ if(APPLE)
199199
${CMAKE_CURRENT_SOURCE_DIR}/third-party/coremltools/deps/protobuf/cmake
200200
)
201201

202-
target_link_options_shared_lib(libprotobuf-lite)
202+
executorch_target_link_options_shared_lib(libprotobuf-lite)
203203
target_link_libraries(coremldelegate PRIVATE libprotobuf-lite)
204204
endif()
205205

@@ -210,7 +210,7 @@ if(APPLE)
210210
${FOUNDATION_FRAMEWORK} ${SQLITE_LIBRARY}
211211
)
212212

213-
target_link_options_shared_lib(coremldelegate)
213+
executorch_target_link_options_shared_lib(coremldelegate)
214214

215215
if(EXECUTORCH_COREML_BUILD_EXECUTOR_RUNNER)
216216
target_link_libraries(

backends/apple/mps/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ target_link_libraries(
7070
${MPS_FRAMEWORK} ${MPS_GRAPH_FRAMEWORK}
7171
)
7272

73-
target_link_options_shared_lib(mpsdelegate)
73+
executorch_target_link_options_shared_lib(mpsdelegate)
7474
target_compile_options(mpsdelegate PUBLIC ${_common_compile_options})
7575
target_compile_options(mpsdelegate PRIVATE "-fno-objc-arc")
7676

backends/cadence/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ if(EXECUTORCH_CADENCE_CPU_RUNNER)
3535
# Find prebuilt libraries. executorch package should contain portable_ops_lib,
3636
# etdump, bundled_program.
3737
find_package(executorch CONFIG REQUIRED)
38-
target_link_options_shared_lib(executorch)
39-
target_link_options_shared_lib(portable_ops_lib)
38+
executorch_target_link_options_shared_lib(executorch)
39+
executorch_target_link_options_shared_lib(portable_ops_lib)
4040

4141
target_include_directories(executorch INTERFACE ${_common_include_directories})
4242

backends/mediatek/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ target_sources(
4040
${CMAKE_CURRENT_LIST_DIR}/runtime/NeuronExecutor.cpp
4141
${CMAKE_CURRENT_LIST_DIR}/runtime/NeuronBufferAllocator.cpp
4242
)
43-
target_link_options_shared_lib(neuron_backend)
43+
executorch_target_link_options_shared_lib(neuron_backend)
4444

4545
install(TARGETS neuron_backend DESTINATION lib)

backends/openvino/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ target_link_libraries(openvino_backend PRIVATE openvino::runtime executorch_core
4646
# Add source files for OpenVINO backend
4747
target_sources(openvino_backend PRIVATE ${CMAKE_CURRENT_LIST_DIR}/runtime/OpenvinoBackend.cpp)
4848

49-
target_link_options_shared_lib(openvino_backend)
49+
executorch_target_link_options_shared_lib(openvino_backend)
5050

5151
if(EXECUTORCH_BUILD_OPENVINO_EXECUTOR_RUNNER)
5252
# Build executor runner binary for openvino backend

backends/qualcomm/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ target_link_libraries(
209209
#
210210
# add linker option
211211
#
212-
target_link_options_shared_lib(qnn_executorch_backend)
212+
executorch_target_link_options_shared_lib(qnn_executorch_backend)
213213

214214
#
215215
# add sources

backends/vulkan/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ if(NOT RUNTIME_PATH)
2424
set(RUNTIME_PATH ${CMAKE_CURRENT_SOURCE_DIR}/runtime)
2525
endif()
2626

27-
# Include this file to access target_link_options_shared_lib This is required to
28-
# provide access to target_link_options_shared_lib which allows libraries to be
29-
# linked with the --whole-archive flag. This is required for libraries that
30-
# perform dynamic registration via static initialization.
27+
# Include this file to access executorch_target_link_options_shared_lib This is
28+
# required to provide access to executorch_target_link_options_shared_lib which
29+
# allows libraries to be linked with the --whole-archive flag. This is required
30+
# for libraries that perform dynamic registration via static initialization.
3131
include(${EXECUTORCH_ROOT}/tools/cmake/Utils.cmake)
3232

3333
include(cmake/ShaderLibrary.cmake)
@@ -113,7 +113,7 @@ target_include_directories(
113113
target_link_libraries(vulkan_backend PRIVATE vulkan_schema executorch_core)
114114
target_compile_options(vulkan_backend PRIVATE ${VULKAN_CXX_FLAGS})
115115
# Link this library with --whole-archive due to dynamic backend registration
116-
target_link_options_shared_lib(vulkan_backend)
116+
executorch_target_link_options_shared_lib(vulkan_backend)
117117

118118
set_property(TARGET vulkan_backend PROPERTY CXX_STANDARD 17)
119119

backends/vulkan/cmake/ShaderLibrary.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function(vulkan_shader_lib library_name generated_spv_cpp)
8181
target_link_libraries(${library_name} vulkan_backend)
8282
target_compile_options(${library_name} PRIVATE ${VULKAN_CXX_FLAGS})
8383
# Link this library with --whole-archive due to dynamic shader registrations
84-
target_link_options_shared_lib(${library_name})
84+
executorch_target_link_options_shared_lib(${library_name})
8585
endfunction()
8686

8787
# Convenience macro to generate a SPIR-V shader library target. Given the path
@@ -105,7 +105,7 @@ macro(vulkan_shader_library shaders_path library_name)
105105
target_link_libraries(${library_name} vulkan_backend)
106106
target_compile_options(${library_name} PRIVATE ${VULKAN_CXX_FLAGS})
107107
# Link this library with --whole-archive due to dynamic shader registrations
108-
target_link_options_shared_lib(${library_name})
108+
executorch_target_link_options_shared_lib(${library_name})
109109

110110
unset(VULKAN_SHADERGEN_ENV)
111111
unset(VULKAN_SHADERGEN_OUT_PATH)

backends/vulkan/test/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ if(TARGET vulkan_backend)
3535
set(PYTHON_EXECUTABLE python3)
3636
endif()
3737

38-
# Include this file to access target_link_options_shared_lib This is required
39-
# to provide access to target_link_options_shared_lib which allows libraries
38+
# Include this file to access executorch_target_link_options_shared_lib This is required
39+
# to provide access to executorch_target_link_options_shared_lib which allows libraries
4040
# to be linked with the --whole-archive flag. This is required for libraries
4141
# that perform dynamic registration via static initialization.
4242
include(${EXECUTORCH_ROOT}/tools/cmake/Utils.cmake)
@@ -75,7 +75,7 @@ if(TARGET vulkan_backend)
7575
${CMAKE_CURRENT_SOURCE_DIR}/vulkan_compute_api_test.cpp
7676
)
7777

78-
target_link_options_shared_lib(vulkan_backend)
78+
executorch_target_link_options_shared_lib(vulkan_backend)
7979

8080
add_executable(
8181
vulkan_compute_api_test ${COMPUTE_API_TEST_CPP} ${TEST_UTILS_CPP}

0 commit comments

Comments
 (0)