Skip to content

Commit

Permalink
[QNN EP] Fix compile error for QNN EP on Windows x64 due to missing /…
Browse files Browse the repository at this point in the history
…bigobj flag (#21795)

### Description
Compiling onnxruntime with QNN EP on Windows x86_64 results in a
compilation error:
```shell
$ onnxruntime\test\optimizer\qdq_transformer_test.cc(1,1): error C1128: num
ber of sections exceeded object file format limit: compile with /bigobj [...onnxruntime\build\Debug\onnxruntime_test_all.vcxproj]
```

This PR adds the `/bigobj` compilation flag for the
`qdq_transformer_test.cc` file.
  • Loading branch information
adrianlizarraga authored Aug 20, 2024
1 parent fbc3927 commit 28c252c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmake/onnxruntime_unittests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -887,9 +887,10 @@ if (MSVC)
target_compile_options(onnxruntime_test_all PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:--compiler-options /wd4244>"
"$<$<NOT:$<COMPILE_LANGUAGE:CUDA>>:/wd4244>")

# Avoid this compile error in graph_transform_test.cc:
# Avoid this compile error in graph_transform_test.cc and qdq_transformer_test.cc:
# fatal error C1128: number of sections exceeded object file format limit: compile with /bigobj
set_property(SOURCE "${TEST_SRC_DIR}/optimizer/graph_transform_test.cc"
"${TEST_SRC_DIR}/optimizer/qdq_transformer_test.cc"
APPEND PROPERTY COMPILE_OPTIONS "/bigobj")
else()
target_compile_options(onnxruntime_test_all PRIVATE "-Wno-parentheses")
Expand Down

0 comments on commit 28c252c

Please sign in to comment.