Skip to content

Commit

Permalink
Go back to original protobuf_generate_cpp
Browse files Browse the repository at this point in the history
Want to see what the output and stuff looks like from that
  • Loading branch information
KangarooKoala committed Dec 31, 2023
1 parent 46592b4 commit b7daedc
Showing 1 changed file with 13 additions and 19 deletions.
32 changes: 13 additions & 19 deletions wpimath/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ include(CompileWarnings)
include(AddTest)
include(DownloadAndCheck)

# workaround for makefiles - for some reason parent directories aren't created.
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/protobuf")
file(GLOB wpimath_proto_src src/main/proto/*.proto)
protobuf_generate_cpp(
WPIMATH_PROTO_SRCS
WPIMATH_PROTO_HDRS
PROTOC_OUT_DIR
"${CMAKE_CURRENT_BINARY_DIR}/protobuf"
PROTOS
${wpimath_proto_src}
)

function(quickbuf_generate SRCS JAVA_PACKAGE)
if(NOT ARGN)
message(SEND_ERROR "Error: PROTOBUF_GENERATE_QUICKBUF() called without any proto files")
Expand Down Expand Up @@ -190,29 +202,11 @@ endif()
file(GLOB_RECURSE wpimath_native_src src/main/native/cpp/*.cpp)
list(REMOVE_ITEM wpimath_native_src ${wpimath_jni_src})

file(GLOB wpimath_proto_src src/main/proto/*.proto)

set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS FALSE)
add_library(wpimath ${wpimath_native_src} ${wpimath_proto_src})
add_library(wpimath ${wpimath_native_src} ${WPIMATH_PROTO_SRCS})
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
set_target_properties(wpimath PROPERTIES DEBUG_POSTFIX "d")

if(MSVC)
set(export_macro "__declspec(dllexport)")
endif()
protobuf_generate(
TARGET
wpimath
EXPORT_MACRO
${export_macro}
OUT_VAR
protobuf_generated_srcs
PROTOC_OUT_DIR
"${CMAKE_CURRENT_BINARY_DIR}/protobuf"
APPEND_PATH
)
target_sources(wpimath PUBLIC ${protobuf_generated_srcs})

add_custom_command(
TARGET wpimath
PRE_LINK
Expand Down

0 comments on commit b7daedc

Please sign in to comment.