From 734c268d081d33d6e4e241a1b05abae841adf78e Mon Sep 17 00:00:00 2001 From: Jacob Wujciak-Jens Date: Tue, 13 Aug 2024 02:17:18 +0200 Subject: [PATCH] add separate target for proto wraper files --- velox/dwio/dwrf/common/CMakeLists.txt | 10 +++------ velox/dwio/dwrf/common/wrap/CMakeLists.txt | 25 ++++++++++++++++++++++ velox/dwio/dwrf/proto/CMakeLists.txt | 6 ++---- 3 files changed, 30 insertions(+), 11 deletions(-) create mode 100644 velox/dwio/dwrf/common/wrap/CMakeLists.txt diff --git a/velox/dwio/dwrf/common/CMakeLists.txt b/velox/dwio/dwrf/common/CMakeLists.txt index 427e2a294386b..cfd63f87e68ea 100644 --- a/velox/dwio/dwrf/common/CMakeLists.txt +++ b/velox/dwio/dwrf/common/CMakeLists.txt @@ -24,13 +24,7 @@ velox_add_library( IntEncoder.cpp RLEv1.cpp RLEv2.cpp - Statistics.cpp - wrap/dwrf-proto-wrapper.cpp - wrap/orc-proto-wrapper.cpp) - -if(NOT VELOX_MONO_LIBRARY) - add_dependencies(velox_dwio_dwrf_common velox_dwio_dwrf_proto) -endif() + Statistics.cpp) velox_link_libraries( velox_dwio_dwrf_common @@ -43,3 +37,5 @@ velox_link_libraries( velox_caching Snappy::snappy zstd::zstd) + +add_subdirectory(wrap) diff --git a/velox/dwio/dwrf/common/wrap/CMakeLists.txt b/velox/dwio/dwrf/common/wrap/CMakeLists.txt new file mode 100644 index 0000000000000..f08e457be1a53 --- /dev/null +++ b/velox/dwio/dwrf/common/wrap/CMakeLists.txt @@ -0,0 +1,25 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# These files wrap the generated source and header files from +# velox_dwio_dwrf_proto with pragamas to disable certain warnings TODO: transfer +# disabling the warnings to CMake/Buck +velox_add_library(velox_dwio_dwrf_proto orc-proto-wrapper.cpp + dwrf-proto-wrapper.cpp) +velox_link_libraries(velox_dwio_dwrf_proto protobuf::libprotobuf) +velox_include_directories(velox_dwio_dwrf_proto PUBLIC ${PROJECT_BINARY_DIR}) + +if(NOT VELOX_MONO_LIBRARY) + add_dependencies(velox_dwio_dwrf_proto dwio_proto) +endif() diff --git a/velox/dwio/dwrf/proto/CMakeLists.txt b/velox/dwio/dwrf/proto/CMakeLists.txt index 299587a1f4158..af648f51569aa 100644 --- a/velox/dwio/dwrf/proto/CMakeLists.txt +++ b/velox/dwio/dwrf/proto/CMakeLists.txt @@ -47,10 +47,8 @@ add_custom_target(dwio_proto ALL DEPENDS ${PROTO_OUTPUT_FILES}) if(VELOX_MONO_LIBRARY) add_dependencies(velox dwio_proto) endif() -velox_add_library(velox_dwio_dwrf_proto ${PROTO_HDRS} ${PROTO_SRCS}) # Access generated proto file with. # -# #include "velox/dwio/dwrf/proto/dwrf_proto.pb.h" -velox_link_libraries(velox_dwio_dwrf_proto protobuf::libprotobuf) -velox_include_directories(velox_dwio_dwrf_proto PUBLIC ${PROJECT_BINARY_DIR}) +# #include "velox/dwio/dwrf/proto/dwrf_proto.pb.h" link against +# velox_dwio_dwrf_proto see velox/dwio/dwrf/common/wrap