Skip to content

Commit a63a648

Browse files
authored
Default CMAKE_SYSTEM_PROCESSOR to the host (#10912)
### Summary Although by default cmake use the host's architecture if `CMAKE_SYSTEM_PROCESSOR` isn't provided, it doesn't actually set the value. This can be an issue in cases where people try to read this value (i.e. [extension/llm/custom_ops/CMakeLists.txt](https://github.com/pytorch/executorch/blob/0a6f6220dd7252f5b79bf7b33edf1ea0631158f3/extension/llm/custom_ops/CMakeLists.txt#L52-L66)). So, let's just explicitly set it. ### Test plan CI cc @larryliu0820
1 parent 9f6c0f2 commit a63a648

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ if(NOT CMAKE_CXX_STANDARD)
5454
endif()
5555
announce_configured_options(CMAKE_CXX_STANDARD)
5656

57+
if(NOT CMAKE_SYSTEM_PROCESSOR)
58+
set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR})
59+
endif()
60+
announce_configured_options(CMAKE_SYSTEM_PROCESSOR)
61+
5762
if(NOT CMAKE_BUILD_TYPE)
5863
set(CMAKE_BUILD_TYPE Debug)
5964
endif()

0 commit comments

Comments
 (0)