Skip to content

Commit 7fcc0af

Browse files
authored
GH-49164: [C++] Avoid invalid if() args in cmake when arrow is a subproject (#49165)
### Rationale for this change Ref #49164: In subproject builds, `DefineOptions.cmake` sets `ARROW_DEFINE_OPTIONS_DEFAULT` to OFF, so `ARROW_SIMD_LEVEL` is never defined. The `if()` at `cpp/src/arrow/io/CMakeLists.txt:48` uses `${ARROW_SIMD_LEVEL}` and expands to empty, leading to invalid `if()` arguments. ### What changes are included in this PR? Use the variable name directly (no `${}`). ### Are these changes tested? Yes. ### Are there any user-facing changes? None. * GitHub Issue: #49164 Authored-by: Rossi Sun <zanmato1984@gmail.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
1 parent d5fa7cb commit 7fcc0af

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cpp/src/arrow/io/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ add_arrow_test(memory_test PREFIX "arrow-io")
4545

4646
add_arrow_benchmark(file_benchmark PREFIX "arrow-io")
4747

48-
if(NOT (${ARROW_SIMD_LEVEL} STREQUAL "NONE") AND NOT (${ARROW_SIMD_LEVEL} STREQUAL "NEON"
49-
))
48+
if(DEFINED ARROW_SIMD_LEVEL
49+
AND NOT (ARROW_SIMD_LEVEL STREQUAL "NONE")
50+
AND NOT (ARROW_SIMD_LEVEL STREQUAL "NEON"))
5051
# This benchmark either requires SSE4.2 or ARMV8 SIMD to be enabled
5152
add_arrow_benchmark(memory_benchmark PREFIX "arrow-io")
5253
endif()

0 commit comments

Comments
 (0)