Skip to content

Commit

Permalink
fixed build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ClemensElflein committed Nov 6, 2024
1 parent f294ec9 commit d9120a4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions codegen/cmake/AddService.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
function(add_service SERVICE_NAME JSON_FILE)
# generate the output directory, otherwise python will complain when multiple instances are run
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/generated/include)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated/include/${SERVICE_NAME}Base.hpp ${CMAKE_CURRENT_BINARY_DIR}/generated/${SERVICE_NAME}Base.cpp
COMMAND ${Python3_EXECUTABLE} -m cogapp -d -I ${XBOT_CODEGEN_PATH}/xbot_codegen -D service_file=${JSON_FILE} -o ${CMAKE_CURRENT_BINARY_DIR}/generated/include/${SERVICE_NAME}Base.hpp ${XBOT_CODEGEN_PATH}/templates/ServiceTemplate.hpp
Expand All @@ -19,6 +21,8 @@ function(add_service SERVICE_NAME JSON_FILE)
endfunction()

function(target_add_service TARGET_NAME SERVICE_NAME JSON_FILE)
# generate the output directory, otherwise python will complain when multiple instances are run
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/generated/include)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated/include/${SERVICE_NAME}Base.hpp ${CMAKE_CURRENT_BINARY_DIR}/generated/${SERVICE_NAME}Base.cpp
COMMAND ${Python3_EXECUTABLE} -m cogapp -d -I ${XBOT_CODEGEN_PATH}/xbot_codegen -D service_file=${JSON_FILE} -o ${CMAKE_CURRENT_BINARY_DIR}/generated/include/${SERVICE_NAME}Base.hpp ${XBOT_CODEGEN_PATH}/templates/ServiceTemplate.hpp
Expand Down
5 changes: 4 additions & 1 deletion codegen/cmake/AddServiceInterface.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
function(add_service_interface SERVICE_INTERFACE_NAME JSON_FILE)
# generate the output directory, otherwise python will complain when multiple instances are run
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/generated/include)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated/include/${SERVICE_INTERFACE_NAME}Base.hpp ${CMAKE_CURRENT_BINARY_DIR}/generated/${SERVICE_INTERFACE_NAME}Base.cpp
COMMAND ${Python3_EXECUTABLE} -m cogapp -d -I ${XBOT_CODEGEN_PATH}/xbot_codegen -D service_file=${JSON_FILE} -o ${CMAKE_CURRENT_BINARY_DIR}/generated/include/${SERVICE_INTERFACE_NAME}Base.hpp ${XBOT_CODEGEN_PATH}/templates/ServiceInterfaceTemplate.hpp
Expand All @@ -19,7 +21,8 @@ function(add_service_interface SERVICE_INTERFACE_NAME JSON_FILE)
endfunction()

function(target_add_service_interface TARGET_NAME SERVICE_INTERFACE_NAME JSON_FILE)

# generate the output directory, otherwise python will complain when multiple instances are run
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/generated/include)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated/include/${SERVICE_INTERFACE_NAME}Base.hpp ${CMAKE_CURRENT_BINARY_DIR}/generated/${SERVICE_INTERFACE_NAME}Base.cpp
COMMAND ${Python3_EXECUTABLE} -m cogapp -d -I ${XBOT_CODEGEN_PATH}/xbot_codegen -D service_file=${JSON_FILE} -o ${CMAKE_CURRENT_BINARY_DIR}/generated/include/${SERVICE_INTERFACE_NAME}Base.hpp ${XBOT_CODEGEN_PATH}/templates/ServiceInterfaceTemplate.hpp
Expand Down
3 changes: 1 addition & 2 deletions libxbot-service/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ project(xbot-service C CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_compile_options(-Wall -Wextra -Werror)


# Allow logging using ulog
#add_compile_definitions(ULOG_ENABLED)
Expand All @@ -16,6 +14,7 @@ add_library(xbot-service STATIC
src/RemoteLogging.cpp
src/ServiceIo.cpp
)
target_compile_options(xbot-service PRIVATE -Wall -Wextra -Werror -Wno-volatile)

if (NOT DEFINED XBOT_CUSTOM_PORT_PATH)
SET(XBOT_CUSTOM_PORT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/src/portable/linux)
Expand Down

0 comments on commit d9120a4

Please sign in to comment.