Skip to content

Commit

Permalink
add separate target for proto wraper files
Browse files Browse the repository at this point in the history
  • Loading branch information
assignUser committed Aug 13, 2024
1 parent 34e1782 commit 734c268
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 11 deletions.
10 changes: 3 additions & 7 deletions velox/dwio/dwrf/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -43,3 +37,5 @@ velox_link_libraries(
velox_caching
Snappy::snappy
zstd::zstd)

add_subdirectory(wrap)
25 changes: 25 additions & 0 deletions velox/dwio/dwrf/common/wrap/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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()
6 changes: 2 additions & 4 deletions velox/dwio/dwrf/proto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 734c268

Please sign in to comment.