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

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


The following commit(s) were added to refs/heads/main by this push:
     new 05f6d1642 ORC-2013: [C++][FOLLOWUP] Respect externally set CMake 
variable PROTOBUF_EXECUTABLE
05f6d1642 is described below

commit 05f6d1642e4d01e012124a5197635ddf6151a086
Author: Gang Wu <[email protected]>
AuthorDate: Mon Oct 13 10:32:43 2025 +0800

    ORC-2013: [C++][FOLLOWUP] Respect externally set CMake variable 
PROTOBUF_EXECUTABLE
    
    ### What changes were proposed in this pull request?
    
    Respect externally set `PROTOBUF_EXECUTABLE` variable.
    
    ### Why are the changes needed?
    
    `conda` may cross-compile `Protobuf` so sometimes it is required to 
explicitly set what `protoc` to use.
    
    ### How was this patch tested?
    
    See https://github.com/conda-forge/orc-feedstock/pull/94.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No
    
    Closes #2438 from wgtmac/fix_conda.
    
    Authored-by: Gang Wu <[email protected]>
    Signed-off-by: Gang Wu <[email protected]>
---
 cmake_modules/ThirdpartyToolchain.cmake | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/cmake_modules/ThirdpartyToolchain.cmake 
b/cmake_modules/ThirdpartyToolchain.cmake
index 2dde7e7e8..c03afa8f2 100644
--- a/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cmake_modules/ThirdpartyToolchain.cmake
@@ -245,7 +245,9 @@ else ()
 
     add_library(orc_protobuf INTERFACE IMPORTED)
     target_link_libraries(orc_protobuf INTERFACE protobuf::libprotobuf)
-    set(PROTOBUF_EXECUTABLE protobuf::protoc)
+    if(NOT PROTOBUF_EXECUTABLE)
+      set(PROTOBUF_EXECUTABLE protobuf::protoc)
+    endif()
   endblock()
 endif ()
 

Reply via email to