Skip to content

Commit

Permalink
Silence warnings when building Plasma
Browse files Browse the repository at this point in the history
  • Loading branch information
pitrou committed Oct 4, 2022
1 parent 02a0ff1 commit 08b9d0f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
19 changes: 18 additions & 1 deletion cpp/cmake_modules/BuildUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ function(ADD_ARROW_LIB LIB_NAME)
EXTRA_INCLUDES
PRIVATE_INCLUDES
DEPENDENCIES
DEFINITIONS
SHARED_INSTALL_INTERFACE_LIBS
STATIC_INSTALL_INTERFACE_LIBS
OUTPUT_PATH)
Expand Down Expand Up @@ -247,6 +248,9 @@ function(ADD_ARROW_LIB LIB_NAME)
if(ARG_DEPENDENCIES)
add_dependencies(${LIB_NAME}_objlib ${ARG_DEPENDENCIES})
endif()
if(ARG_DEFINITIONS)
target_compile_definitions(${LIB_NAME}_objlib PRIVATE ${ARG_DEFINITIONS})
endif()
if(ARG_PRECOMPILED_HEADER_LIB)
reuse_precompiled_header_lib(${LIB_NAME}_objlib ${ARG_PRECOMPILED_HEADER_LIB})
endif()
Expand Down Expand Up @@ -297,6 +301,10 @@ function(ADD_ARROW_LIB LIB_NAME)
add_dependencies(${LIB_NAME}_shared ${EXTRA_DEPS})
endif()

if(ARG_DEFINITIONS)
target_compile_definitions(${LIB_NAME}_shared PRIVATE ${ARG_DEFINITIONS})
endif()

if(ARG_PRECOMPILED_HEADER_LIB)
reuse_precompiled_header_lib(${LIB_NAME}_shared ${ARG_PRECOMPILED_HEADER_LIB})
endif()
Expand Down Expand Up @@ -387,6 +395,10 @@ function(ADD_ARROW_LIB LIB_NAME)
add_dependencies(${LIB_NAME}_static ${EXTRA_DEPS})
endif()

if(ARG_DEFINITIONS)
target_compile_definitions(${LIB_NAME}_static PRIVATE ${ARG_DEFINITIONS})
endif()

if(ARG_PRECOMPILED_HEADER_LIB)
reuse_precompiled_header_lib(${LIB_NAME}_static ${ARG_PRECOMPILED_HEADER_LIB})
endif()
Expand Down Expand Up @@ -632,7 +644,8 @@ function(ADD_TEST_CASE REL_TEST_NAME)
LABELS
EXTRA_LABELS
TEST_ARGUMENTS
PREFIX)
PREFIX
DEFINITIONS)
cmake_parse_arguments(ARG
"${options}"
"${one_value_args}"
Expand Down Expand Up @@ -703,6 +716,10 @@ function(ADD_TEST_CASE REL_TEST_NAME)
add_dependencies(${TEST_NAME} ${ARG_EXTRA_DEPENDENCIES})
endif()

if(ARG_DEFINITIONS)
target_compile_definitions(${TEST_NAME} PRIVATE ${ARG_DEFINITIONS})
endif()

if(ARROW_TEST_MEMCHECK AND NOT ARG_NO_VALGRIND)
add_test(${TEST_NAME}
bash
Expand Down
10 changes: 6 additions & 4 deletions cpp/src/plasma/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ add_arrow_lib(plasma
plasma
SOURCES
${PLASMA_SRCS}
DEFINITIONS
"ARROW_EXPORTING"
"_PLASMA_NO_DEPRECATE"
OUTPUTS
PLASMA_LIBRARIES
SHARED_LINK_FLAGS
Expand All @@ -98,10 +101,6 @@ add_arrow_lib(plasma

add_dependencies(plasma ${PLASMA_LIBRARIES})

foreach(LIB_TARGET ${PLASMA_LIBRARIES})
target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_EXPORTING)
endforeach()

# The optimization flag -O3 is suggested by dlmalloc.c, which is #included in
# malloc.cc; we set it here regardless of whether we do a debug or release build.
set_source_files_properties(dlmalloc.cc PROPERTIES COMPILE_FLAGS "-O3")
Expand Down Expand Up @@ -134,6 +133,7 @@ else()
target_link_libraries(plasma-store-server plasma_shared ${PLASMA_LINK_LIBS})
endif()
target_link_libraries(plasma-store-server ${GFLAGS_LIBRARIES})
target_compile_definitions(plasma-store-server PRIVATE _PLASMA_NO_DEPRECATE)
add_dependencies(plasma plasma-store-server)

if(ARROW_RPATH_ORIGIN)
Expand Down Expand Up @@ -190,6 +190,8 @@ function(ADD_PLASMA_TEST REL_TEST_NAME)
"plasma"
LABELS
"plasma-tests"
DEFINITIONS
_PLASMA_NO_DEPRECATE
${ARG_UNPARSED_ARGUMENTS})
endfunction()

Expand Down
2 changes: 2 additions & 0 deletions cpp/src/plasma/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
#include "arrow/gpu/cuda_api.h"
#endif

#ifndef _PLASMA_NO_DEPRECATE
#warning "Plasma is deprecated since Arrow 10.0.0. It will be removed in 12.0.0 or so."
#endif

namespace plasma {

Expand Down

0 comments on commit 08b9d0f

Please sign in to comment.