This is an automated email from the ASF dual-hosted git repository.

kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new 7fcc0af4e8 GH-49164: [C++] Avoid invalid if() args in cmake when arrow 
is a subproject (#49165)
7fcc0af4e8 is described below

commit 7fcc0af4e8d21a024cade7018b650fb528867da8
Author: Rossi Sun <[email protected]>
AuthorDate: Sat Feb 7 20:27:50 2026 +0800

    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 <[email protected]>
    Signed-off-by: Sutou Kouhei <[email protected]>
---
 cpp/src/arrow/io/CMakeLists.txt | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/cpp/src/arrow/io/CMakeLists.txt b/cpp/src/arrow/io/CMakeLists.txt
index 623fcde413..f37844026d 100644
--- a/cpp/src/arrow/io/CMakeLists.txt
+++ b/cpp/src/arrow/io/CMakeLists.txt
@@ -45,8 +45,9 @@ add_arrow_test(memory_test PREFIX "arrow-io")
 
 add_arrow_benchmark(file_benchmark PREFIX "arrow-io")
 
-if(NOT (${ARROW_SIMD_LEVEL} STREQUAL "NONE") AND NOT (${ARROW_SIMD_LEVEL} 
STREQUAL "NEON"
-                                                     ))
+if(DEFINED ARROW_SIMD_LEVEL
+   AND NOT (ARROW_SIMD_LEVEL STREQUAL "NONE")
+   AND NOT (ARROW_SIMD_LEVEL STREQUAL "NEON"))
   # This benchmark either requires SSE4.2 or ARMV8 SIMD to be enabled
   add_arrow_benchmark(memory_benchmark PREFIX "arrow-io")
 endif()

Reply via email to