From 037a0d36c8c2a1eae9012f7d40fd7e971de95c49 Mon Sep 17 00:00:00 2001 From: Mergen Nachin Date: Fri, 13 Dec 2024 13:40:04 -0500 Subject: [PATCH] Be able to compile in offline mode (#7305) --- .gitignore | 1 + CMakeLists.txt | 11 +++++++++++ build/Utils.cmake | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 176edf9300..c68945615b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .hypothesis buck-out/ +buck2-bin/ cmake-out* .DS_Store cmake-android-out/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 46fec4cf0c..9d79b49e6e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -257,6 +257,17 @@ if(EXECUTORCH_BUILD_KERNELS_CUSTOM) set(EXECUTORCH_BUILD_KERNELS_OPTIMIZED ON) endif() +if(NOT DEFINED FXDIV_SOURCE_DIR) + set(ORIGINAL_CMAKE_POSITION_INDEPENDENT_CODE_FLAG + ${CMAKE_POSITION_INDEPENDENT_CODE} + ) + set(FXDIV_SOURCE_DIR "backends/xnnpack/third-party/FXdiv") + add_subdirectory("${FXDIV_SOURCE_DIR}") + set(CMAKE_POSITION_INDEPENDENT_CODE + ${ORIGINAL_CMAKE_POSITION_INDEPENDENT_CODE_FLAG} + ) +endif() + if(EXECUTORCH_BUILD_CPUINFO) # --- cpuinfo set(ORIGINAL_CMAKE_POSITION_INDEPENDENT_CODE_FLAG diff --git a/build/Utils.cmake b/build/Utils.cmake index f9aafefdff..7641e7c7dc 100644 --- a/build/Utils.cmake +++ b/build/Utils.cmake @@ -235,7 +235,7 @@ function(resolve_buck2) set(resolve_buck2_command ${PYTHON_EXECUTABLE} ${executorch_root}/build/resolve_buck.py - --cache_dir=${CMAKE_CURRENT_BINARY_DIR}/buck2-bin + --cache_dir=buck2-bin ) if(NOT ${BUCK2} STREQUAL "")