Skip to content

Commit 07b9477

Browse files
committed
[Windows] misc fixes to enable Windows build
1 parent e3c7954 commit 07b9477

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

backends/xnnpack/CMakeLists.txt

+9-1
Original file line numberDiff line numberDiff line change
@@ -73,19 +73,27 @@ foreach(fbs_file ${_xnnpack_schema__srcs})
7373
)
7474
endforeach()
7575

76+
if(WIN32)
77+
set(MV_COMMAND powershell -Command "Move-Item -Path ${_xnnpack_flatbuffer__outputs} -Destination ${_xnnpack_schema__outputs}")
78+
else()
79+
set(MV_COMMAND mv ${_xnnpack_flatbuffer__outputs} ${_xnnpack_schema__outputs})
80+
endif()
81+
7682
# Generate the headers from the .fbs files.
7783
add_custom_command(
7884
OUTPUT ${_xnnpack_schema__outputs}
7985
COMMAND
8086
${FLATC_EXECUTABLE} --cpp --cpp-std c++11 --scoped-enums -o
8187
"${_xnnpack_schema__include_dir}/executorch/backends/xnnpack/serialization"
8288
${_xnnpack_schema__srcs}
83-
COMMAND mv ${_xnnpack_flatbuffer__outputs} ${_xnnpack_schema__outputs}
89+
COMMAND ${MV_COMMAND}
8490
WORKING_DIRECTORY ${EXECUTORCH_ROOT}
8591
COMMENT "Generating xnnpack_schema headers"
8692
VERBATIM
8793
)
8894

95+
unset(MV_COMMAND)
96+
8997
add_library(xnnpack_schema INTERFACE ${_xnnpack_schema__outputs})
9098
set_target_properties(xnnpack_schema PROPERTIES LINKER_LANGUAGE CXX)
9199
target_include_directories(

extension/llm/custom_ops/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64|armv7)$")
4949
list(APPEND _custom_ops__srcs
5050
"extension/llm/custom_ops/spinquant/third-party/FFHT/fht_neon.c"
5151
)
52-
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
52+
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64)")
5353
list(APPEND _custom_ops__srcs
5454
"extension/llm/custom_ops/spinquant/third-party/FFHT/fht_avx.c"
5555
)

install_executorch.bat

+2-8
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,8 @@ rem This batch file provides a basic functionality similar to the bash script.
77

88
cd /d "%~dp0"
99

10-
rem Find the names of the python tools to use (replace with your actual python installation)
11-
if "%PYTHON_EXECUTABLE%"=="" (
12-
if "%CONDA_DEFAULT_ENV%"=="" OR "%CONDA_DEFAULT_ENV%"=="base" OR NOT EXIST "python" (
13-
set PYTHON_EXECUTABLE=python3
14-
) else (
15-
set PYTHON_EXECUTABLE=python
16-
)
17-
)
10+
rem Under windows, it's always python
11+
set PYTHON_EXECUTABLE=python
1812

1913
"%PYTHON_EXECUTABLE%" install_executorch.py %*
2014

0 commit comments

Comments
 (0)