Skip to content

Commit

Permalink
Be able to compile in offline mode (pytorch#7305)
Browse files Browse the repository at this point in the history
  • Loading branch information
mergennachin authored Dec 13, 2024
1 parent cb04347 commit 037a0d3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.hypothesis
buck-out/
buck2-bin/
cmake-out*
.DS_Store
cmake-android-out/
Expand Down
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion build/Utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 "")
Expand Down

0 comments on commit 037a0d3

Please sign in to comment.