Skip to content

Commit

Permalink
Update comments, copyrights and rename matrix_multiply_tcp_python
Browse files Browse the repository at this point in the history
  • Loading branch information
JanKomarekNXP committed Feb 29, 2024
1 parent 628f9e3 commit 4350e55
Show file tree
Hide file tree
Showing 33 changed files with 80 additions and 29 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2023-2024 NXP
# Copyright 2024 NXP
#
# SPDX-License-Identifier: BSD-3-Clause
#
Expand All @@ -14,7 +14,7 @@ set(ERPC_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
# Build erpc_c lib
add_subdirectory(erpc_c)

# Include generate_erpc_files
# Include function generate_erpc_files to be in global scope
include(${ERPC_ROOT}/generate_erpc_files.cmake)

# Option for building eRPC project
Expand All @@ -23,15 +23,15 @@ option(BUILD_EXAMPLES "Build example executables" ON)
option(BUILD_ERPCGEN "Build erpcgen" ON)
option(ERPCGEN "Path to erpcgen executable")

# BUILD_TESTS and BUILD_EXAMPLES required erpcgen
# BUILD_TESTS and BUILD_EXAMPLES require erpcgen
if(BUILD_TESTS OR BUILD_EXAMPLES)
if (ERPCGEN)
if (NOT IS_ABSOLUTE ${ERPCGEN})
set(ERPCGEN ${CMAKE_CURRENT_SOURCE_DIR}/${ERPCGEN})
endif()
else()
if(NOT BUILD_ERPCGEN)
message(FATAL_ERROR "No ERPCGEN specified and BUILD_ERPCGEN is disabled. Not able to generate erpc file!")
message(FATAL_ERROR "No ERPCGEN specified and BUILD_ERPCGEN is disabled. Unable to generate erpc file!")
endif()

set(ERPCGEN $<TARGET_FILE:erpcgen>)
Expand Down
5 changes: 3 additions & 2 deletions erpc_c/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2023-2024 NXP
# Copyright 2024 NXP
#
# SPDX-License-Identifier: BSD-3-Clause
#
Expand Down Expand Up @@ -46,7 +46,8 @@ set(ERPC_SOURCES
${ERPC_DIR}/transports/erpc_tcp_transport.cpp
${ERPC_DIR}/transports/erpc_serial_transport.cpp

# ${ERPC_DIR}/port/erpc_serial.cpp
# TODO: Add serial transport support
# ${ERPC_DIR}/port/erpc_serial.cpp
)

# Create erpc library
Expand Down
10 changes: 7 additions & 3 deletions erpcgen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

set(ERPCGEN_ROOT ${ERPC_ROOT}/erpcgen)

# Paths to executable
set(PYTHON_SCRIPT ${ERPCGEN_ROOT}/bin/txt_to_c.py)
# Find executables
find_program(PYTHON NAMES python python3 python36 DOC "Python executable location")
find_program(FLEX NAMES flex win_flex.exe HINTS ${ERPCGEN_ROOT}/VisualStudio_v14)
find_program(BISON NAMES bison win_bison.exe HINTS ${ERPCGEN_ROOT}/VisualStudio_v14)

Expand All @@ -23,6 +23,9 @@ endif()
set(YYFLAGS "-Wno-other")
set(LLFLAGS "")

# Python text-to-c script
set(PYTHON_SCRIPT ${ERPCGEN_ROOT}/bin/txt_to_c.py)

# erpcgen sources
set(ERPCGEN_SOURCE
${ERPCGEN_ROOT}/src/cpptemplate/cpptempl.cpp
Expand Down Expand Up @@ -68,6 +71,7 @@ set(ERPCGEN_INCLUDES
set(ERPCGEN_TEMPLATE_DIR ${ERPCGEN_ROOT}/src/templates)
set(ERPCGEN_TEMPLATE_OUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/src/templates)

# List of all templates
set(ERPCGEN_TEMPLATE_NAMES
c_common_header.template
cpp_interface_header.template
Expand Down Expand Up @@ -107,7 +111,7 @@ foreach(template ${ERPCGEN_TEMPLATE_NAMES})
add_custom_command(
OUTPUT ${ERPCGEN_TEMPLATE_OUT_DIR}/${c_file}
COMMAND ${CMAKE_COMMAND} -E make_directory ${ERPCGEN_TEMPLATE_OUT_DIR}
COMMAND python ${PYTHON_SCRIPT} -o ${ERPCGEN_TEMPLATE_OUT_DIR}/${c_file}
COMMAND ${PYTHON} ${PYTHON_SCRIPT} -o ${ERPCGEN_TEMPLATE_OUT_DIR}/${c_file}
${ERPCGEN_TEMPLATE_DIR}/${template}
DEPENDS ${ERPCGEN_TEMPLATE_DIR}/${template}
COMMENT "Generating ${template} -> ${c_file}"
Expand Down
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2023-2024 NXP
# Copyright 2024 NXP
#
# SPDX-License-Identifier: BSD-3-Clause
#
Expand Down
4 changes: 4 additions & 0 deletions examples/hello_world/c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ generate_erpc_files(
target_sources(client PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/main_client.c
${CMAKE_CURRENT_SOURCE_DIR}/erpc_error_handler.cpp

${ERPC_OUT_DIR}/c_hello_world_client.cpp
${ERPC_OUT_DIR}/hello_world_client.cpp
${ERPC_OUT_DIR}/hello_world_interface.cpp
Expand All @@ -48,6 +49,7 @@ target_sources(client PRIVATE
target_sources(server PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/main_server.c
${CMAKE_CURRENT_SOURCE_DIR}/erpc_error_handler.cpp

${ERPC_OUT_DIR}/c_hello_world_server.cpp
${ERPC_OUT_DIR}/hello_world_server.cpp
${ERPC_OUT_DIR}/hello_world_interface.cpp
Expand All @@ -56,13 +58,15 @@ target_sources(server PRIVATE
target_sources(client_cpp PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/main_client.cpp
${CMAKE_CURRENT_SOURCE_DIR}/erpc_error_handler.cpp

${ERPC_OUT_DIR}/hello_world_client.cpp
${ERPC_OUT_DIR}/hello_world_interface.cpp
)

target_sources(server_cpp PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/main_server.cpp
${CMAKE_CURRENT_SOURCE_DIR}/erpc_error_handler.cpp

${ERPC_OUT_DIR}/hello_world_server.cpp
${ERPC_OUT_DIR}/hello_world_interface.cpp
)
Expand Down
10 changes: 4 additions & 6 deletions examples/matrix_multiply_c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,24 @@ set(INCLUDE_DIRS

target_sources(matrix_multiply_client PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/main_client.c

${CMAKE_CURRENT_SOURCE_DIR}/erpc_error_handler.cpp

${ERPC_OUT_DIR}/${APP_NAME}_interface.cpp
${ERPC_OUT_DIR}/${APP_NAME}_client.cpp
${ERPC_OUT_DIR}/c_${APP_NAME}_client.cpp
${ERPC_OUT_DIR}/${APP_NAME}_client.cpp
)

target_sources(matrix_multiply_server PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/main_server.c

${CMAKE_CURRENT_SOURCE_DIR}/erpc_error_handler.cpp

${ERPC_OUT_DIR}/${APP_NAME}_interface.cpp
${ERPC_OUT_DIR}/${APP_NAME}_server.cpp
${ERPC_OUT_DIR}/c_${APP_NAME}_server.cpp
${ERPC_OUT_DIR}/${APP_NAME}_server.cpp
)

target_sources(matrix_multiply_client_cpp PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/main_client.cpp

${CMAKE_CURRENT_SOURCE_DIR}/erpc_error_handler.cpp

${ERPC_OUT_DIR}/${APP_NAME}_interface.cpp
Expand All @@ -69,7 +66,6 @@ target_sources(matrix_multiply_client_cpp PRIVATE

target_sources(matrix_multiply_server_cpp PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/main_server.cpp

${CMAKE_CURRENT_SOURCE_DIR}/erpc_error_handler.cpp

${ERPC_OUT_DIR}/${APP_NAME}_interface.cpp
Expand All @@ -78,12 +74,14 @@ target_sources(matrix_multiply_server_cpp PRIVATE

target_include_directories(matrix_multiply_client PRIVATE ${INCLUDE_DIRS})
target_include_directories(matrix_multiply_server PRIVATE ${INCLUDE_DIRS})

target_include_directories(matrix_multiply_client_cpp PRIVATE ${INCLUDE_DIRS})
target_include_directories(matrix_multiply_server_cpp PRIVATE ${INCLUDE_DIRS})

find_package(Threads REQUIRED)

target_link_libraries(matrix_multiply_client PRIVATE erpc Threads::Threads)
target_link_libraries(matrix_multiply_server PRIVATE erpc Threads::Threads)

target_link_libraries(matrix_multiply_client_cpp PRIVATE erpc Threads::Threads)
target_link_libraries(matrix_multiply_server_cpp PRIVATE erpc Threads::Threads)
3 changes: 3 additions & 0 deletions examples/matrix_multiply_java/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions examples/matrix_multiply_java/.idea/checkstyle-idea.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions examples/matrix_multiply_java/.idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions examples/matrix_multiply_java/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions examples/matrix_multiply_java/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
2 changes: 1 addition & 1 deletion test/test_annotations/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2023-2024 NXP
# Copyright 2024 NXP
#
# SPDX-License-Identifier: BSD-3-Clause
#
Expand Down
2 changes: 1 addition & 1 deletion test/test_arbitrator/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2023-2024 NXP
# Copyright 2024 NXP
#
# SPDX-License-Identifier: BSD-3-Clause
#
Expand Down
2 changes: 1 addition & 1 deletion test/test_arrays/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2023-2024 NXP
# Copyright 2024 NXP
#
# SPDX-License-Identifier: BSD-3-Clause
#
Expand Down
2 changes: 1 addition & 1 deletion test/test_binary/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2023-2024 NXP
# Copyright 2024 NXP
#
# SPDX-License-Identifier: BSD-3-Clause
#
Expand Down
2 changes: 1 addition & 1 deletion test/test_builtin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2023-2024 NXP
# Copyright 2024 NXP
#
# SPDX-License-Identifier: BSD-3-Clause
#
Expand Down
2 changes: 1 addition & 1 deletion test/test_callbacks/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2023-2024 NXP
# Copyright 2024 NXP
#
# SPDX-License-Identifier: BSD-3-Clause
#
Expand Down
2 changes: 1 addition & 1 deletion test/test_const/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2023-2024 NXP
# Copyright 2024 NXP
#
# SPDX-License-Identifier: BSD-3-Clause
#
Expand Down
2 changes: 1 addition & 1 deletion test/test_enums/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2023-2024 NXP
# Copyright 2024 NXP
#
# SPDX-License-Identifier: BSD-3-Clause
#
Expand Down
2 changes: 1 addition & 1 deletion test/test_lists/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2023-2024 NXP
# Copyright 2024 NXP
#
# SPDX-License-Identifier: BSD-3-Clause
#
Expand Down
2 changes: 1 addition & 1 deletion test/test_shared/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2023-2024 NXP
# Copyright 2024 NXP
#
# SPDX-License-Identifier: BSD-3-Clause
#
Expand Down
2 changes: 1 addition & 1 deletion test/test_struct/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2023-2024 NXP
# Copyright 2024 NXP
#
# SPDX-License-Identifier: BSD-3-Clause
#
Expand Down
2 changes: 1 addition & 1 deletion test/test_typedef/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2023-2024 NXP
# Copyright 2024 NXP
#
# SPDX-License-Identifier: BSD-3-Clause
#
Expand Down
2 changes: 1 addition & 1 deletion test/test_unions/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2023-2024 NXP
# Copyright 2024 NXP
#
# SPDX-License-Identifier: BSD-3-Clause
#
Expand Down

0 comments on commit 4350e55

Please sign in to comment.