Skip to content

Commit

Permalink
fix the build issue for Win Arm64 Release build (#20475)
Browse files Browse the repository at this point in the history
### Description
Fix the build error for Win ARM64 Release build.
graph_transform_test.cc(1,1): error C1128: number of sections exceeded
object file format limit: compile with /bigobj
[D:\build\Windows\Release\onnxruntime_test_all.vcxproj]


### Motivation and Context
Fix issue: #20406
  • Loading branch information
HectorSVC authored Apr 26, 2024
1 parent cc26b2d commit d2d4639
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmake/onnxruntime_unittests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,11 @@ if (MSVC)
"$<$<NOT:$<COMPILE_LANGUAGE:CUDA>>:/wd26451>")
target_compile_options(onnxruntime_test_all PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:--compiler-options /wd4244>"
"$<$<NOT:$<COMPILE_LANGUAGE:CUDA>>:/wd4244>")
# Avoid the error for Win arm64 Release build. error C1128: number of sections exceeded object file format limit: compile with /bigobj
string(TOLOWER ${onnxruntime_target_platform} GEN_PLATFORM)
if (${GEN_PLATFORM} STREQUAL "arm64" AND "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
target_compile_options(onnxruntime_test_all PRIVATE "/bigobj")
endif()
else()
target_compile_options(onnxruntime_test_all PRIVATE "-Wno-parentheses")
endif()
Expand Down

0 comments on commit d2d4639

Please sign in to comment.