Skip to content

Commit e3818cb

Browse files
dibpintoDiana Pinto
andauthored
capicxx-core-runtime 3.2.3-r7 (#45)
* capicxx-core-runtime 3.2.3-r7 - Fixed warnings with gcc11 for Wextra-extra-semi flag - Fix capi-core-runtime Runtime::loadLibrary - vSomeIP Security: Update vsomeip_sec - Fixed commonapi-core-runtime windows build - Fix race condition. - Remove mutex and add exception handling to RuntimeDeinit. - Fix double initialization of loggerImpl. - Linux: avoid static initialization of std::mutex - Replace deprecated std::ptr_fun - Properly initialize Runtime::defaultCallTimeout_ - Removed GENIVI copyright line - Fix bug in assignment operator of Variant in case of self-assignment - Ensure to stop struct deserialization on error - Implement "no_timeout" in method responses - Use COMMONAPI_EXPORT_CLASS_EXPLICIT to export classes - Removed libdlt dependency from android - Add support to logs in Android - Update android build files - Support retrieval of environment (hostname) from client identifier. - Use lock objects and remove self assignment. * Fix Copyright field and github link in README file --------- Co-authored-by: Diana Pinto <[email protected]>
1 parent 89720d3 commit e3818cb

24 files changed

+486
-238
lines changed

Android.bp

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,54 @@
1-
capi_srcs = [
2-
"src/CommonAPI/**/*.cpp"
3-
]
4-
51
cc_defaults {
6-
name: "capi_defaults",
2+
name: "libcommonapi_defaults",
3+
4+
rtti: true,
5+
76
cppflags: [
8-
"-std=c++11",
7+
"-std=c++11",
98
"-Wall",
109
"-Wextra",
1110
"-Wformat",
1211
"-Wformat-security",
1312
"-Wconversion",
14-
"-Wno-attributes",
13+
"-Wno-attributes",
1514
"-fexceptions",
1615
"-fstrict-aliasing",
1716
"-fstack-protector",
1817
"-fasynchronous-unwind-tables",
1918
"-fno-omit-frame-pointer",
20-
"-Werror",
21-
"-fvisibility=hidden",
22-
"-DCOMMONAPI_INTERNAL_COMPILATION"
23-
]
19+
"-fvisibility=hidden",
20+
"-Wno-ignored-attributes",
21+
"-Wno-unused-private-field",
22+
"-D_CRT_SECURE_NO_WARNINGS",
23+
"-DCOMMONAPI_INTERNAL_COMPILATION",
24+
"-DCOMMONAPI_LOGLEVEL=COMMONAPI_LOGLEVEL_VERBOSE",
25+
"-DUSE_DLT",
26+
],
27+
28+
proprietary: true,
2429
}
2530

2631
cc_library_shared {
27-
name: "libCommonAPI",
28-
vendor: true,
29-
srcs: capi_srcs,
30-
defaults: [
31-
"capi_defaults"
32-
],
32+
name: "libcommonapi",
33+
defaults: ["libcommonapi_defaults"],
3334
local_include_dirs: [
34-
"include"
35+
"include",
36+
],
37+
38+
shared_libs: [
39+
"liblog",
40+
"libutils",
41+
"libboost_log",
42+
"libboost_system",
43+
"libboost_thread",
44+
],
45+
46+
export_include_dirs: [
47+
"include",
48+
],
49+
srcs: [
50+
"src/CommonAPI/**/*.cpp"
3551
],
36-
export_include_dirs: ["include"],
37-
rtti: true
3852
}
53+
54+

Android.mk

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Cannot convert to Android.bp as resource copying has not
2+
# yet implemented for soong as of 12/16/2016
3+
4+
LOCAL_PATH := $(call my-dir)
5+
6+
include $(CLEAR_VARS)
7+
8+
LOCAL_MODULE := libcommonapi_dlt
9+
LOCAL_MODULE_TAGS := optional
10+
LOCAL_CLANG := true
11+
LOCAL_PROPRIETARY_MODULE := true
12+
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include \
13+
14+
LOCAL_SRC_FILES += \
15+
src/CommonAPI/Address.cpp \
16+
src/CommonAPI/ContainerUtils.cpp \
17+
src/CommonAPI/IniFileReader.cpp \
18+
src/CommonAPI/Logger.cpp \
19+
src/CommonAPI/LoggerImpl.cpp \
20+
src/CommonAPI/MainLoopContext.cpp \
21+
src/CommonAPI/Proxy.cpp \
22+
src/CommonAPI/ProxyManager.cpp \
23+
src/CommonAPI/Runtime.cpp \
24+
src/CommonAPI/Utils.cpp \
25+
26+
LOCAL_C_INCLUDES := \
27+
$(LOCAL_PATH)/include
28+
29+
LOCAL_SHARED_LIBRARIES := \
30+
libboost_log \
31+
libboost_system \
32+
libboost_thread \
33+
34+
LOCAL_CFLAGS := \
35+
-frtti -fexceptions \
36+
-Wno-ignored-attributes \
37+
-D_CRT_SECURE_NO_WARNINGS \
38+
-DCOMMONAPI_INTERNAL_COMPILATION \
39+
-DCOMMONAPI_LOGLEVEL=COMMONAPI_LOGLEVEL_VERBOSE \
40+
41+
include $(BUILD_SHARED_LIBRARY)
42+
43+
44+

CHANGES

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,40 @@
11
Changes
22
=======
33

4+
v3.2.3-r7
5+
- Fixed warnings with gcc11 for Wextra-extra-semi flag
6+
- Fix capi-core-runtime Runtime::loadLibrary
7+
- vSomeIP Security: Update vsomeip_sec
8+
- Fixed commonapi-core-runtime windows build
9+
10+
v3.2.3-r6
11+
- Fix race condition.
12+
- Remove mutex and add exception handling to RuntimeDeinit.
13+
- Fix double initialization of loggerImpl.
14+
15+
v3.2.3-r5
16+
- Linux: avoid static initialization of std::mutex
17+
- Replace deprecated std::ptr_fun
18+
19+
v3.2.3
20+
- Properly initialize Runtime::defaultCallTimeout_
21+
- Removed GENIVI copyright line
22+
- Fix bug in assignment operator of Variant in case of self-assignment
23+
- Ensure to stop struct deserialization on error
24+
- Implement "no_timeout" in method responses
25+
- Use COMMONAPI_EXPORT_CLASS_EXPLICIT to export classes
26+
- Removed libdlt dependency from android
27+
- Add support to logs in Android
28+
- Update android build files
29+
30+
v3.2.2
31+
- Support retrieval of environment (hostname) from client identifier.
32+
33+
v3.2.1
34+
- Use lock objects and remove self assignment.
35+
436
v3.2.0
5-
- Support ABI compatible changes (additional attributes, broadcast and methods added to the end of
37+
- Support ABI compatible changes (additional attributes, broadcast and methods added to the end of
638
the interface specification)
739

840
v3.1.12.6
@@ -47,4 +79,3 @@ v3.1.9
4779
- Added subscription parameter to 'Event::onListenerRemoved' function. This is needed for managing the added and removed listeners respectively for mapping the listeners on the subscription.
4880
- Replaced variadic macros with variadic templates for CommonAPI logger.
4981
- Removed obsolete usleep() macro.
50-

CMakeLists.txt

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ PROJECT(libcommonapi)
1010
# version of CommonAPI
1111
SET( LIBCOMMONAPI_MAJOR_VERSION 3 )
1212
SET( LIBCOMMONAPI_MINOR_VERSION 2 )
13-
SET( LIBCOMMONAPI_PATCH_VERSION 0 )
13+
SET( LIBCOMMONAPI_PATCH_VERSION 3 )
1414

1515
message(STATUS "Project name: ${PROJECT_NAME}")
1616

@@ -24,6 +24,10 @@ message(STATUS "This is CMake for Common API C++ Version ${COMPONENT_VERSION}.")
2424
set(DL_LIBRARY "")
2525
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
2626
set(DL_LIBRARY "dl")
27+
28+
# force all use of std::mutx and std::recursive_mutex to use runtime init
29+
# instead of static initialization so mutexes can be hooked to enable PI as needed
30+
add_definitions(-D_GTHREAD_USE_MUTEX_INIT_FUNC -D_GTHREAD_USE_RECURSIVE_MUTEX_INIT_FUNC)
2731
endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
2832

2933
##############################################################################
@@ -102,7 +106,8 @@ IF(MSVC)
102106
add_definitions(-DCOMMONAPI_INTERNAL_COMPILATION -DCOMMONAPI_DLL_COMPILATION)
103107
add_compile_options(/EHsc /wd4996)
104108
ELSE ()
105-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -Wformat -Wformat-security -Wconversion -fexceptions -fstrict-aliasing -fstack-protector -fasynchronous-unwind-tables -fno-omit-frame-pointer -Werror -DCOMMONAPI_INTERNAL_COMPILATION -fvisibility=hidden")
109+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -Werror=extra-semi -Wformat -Wformat-security -Wconversion -fexceptions -fstrict-aliasing -fstack-protector-strong -fasynchronous-unwind-tables -fno-omit-frame-pointer -Werror -DCOMMONAPI_INTERNAL_COMPILATION -fvisibility=hidden")
110+
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wformat-security -fstack-protector-strong")
106111
ENDIF(MSVC)
107112

108113
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCOMMONAPI_LOGLEVEL=COMMONAPI_LOGLEVEL_${MAX_LOG_LEVEL}")
@@ -129,6 +134,9 @@ list(SORT CAPI_SRCS)
129134
add_library(CommonAPI SHARED ${CAPI_SRCS})
130135
target_link_libraries(CommonAPI PRIVATE ${DL_LIBRARY} ${DLT_LIBRARIES})
131136
set_target_properties(CommonAPI PROPERTIES VERSION ${LIBCOMMONAPI_MAJOR_VERSION}.${LIBCOMMONAPI_MINOR_VERSION}.${LIBCOMMONAPI_PATCH_VERSION} SOVERSION ${LIBCOMMONAPI_MAJOR_VERSION}.${LIBCOMMONAPI_MINOR_VERSION}.${LIBCOMMONAPI_PATCH_VERSION} LINKER_LANGUAGE C)
137+
target_include_directories(CommonAPI INTERFACE
138+
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
139+
$<INSTALL_INTERFACE:${INSTALL_INCLUDE_DIR}>)
132140
set_target_properties (CommonAPI PROPERTIES INTERFACE_LINK_LIBRARY "")
133141

134142
##############################################################################
@@ -167,23 +175,14 @@ export(PACKAGE CommonAPI)
167175
# Create the CommonAPIConfig.cmake and CommonAPIConfigVersion files ...
168176
file(RELATIVE_PATH REL_INCLUDE_DIR "${ABSOLUTE_INSTALL_CMAKE_DIR}" "${ABSOLUTE_INSTALL_INCLUDE_DIR}")
169177

170-
# ... for the build tree
171-
set(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include" )
172178
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/CommonAPIConfig.cmake.in
173179
"${PROJECT_BINARY_DIR}/CommonAPIConfig.cmake" @ONLY)
174-
175-
# ... for the install tree
176-
set(CONF_INCLUDE_DIRS "\${COMMONAPI_CMAKE_DIR}/${REL_INCLUDE_DIR}")
177-
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/CommonAPIConfig.cmake.in
178-
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CommonAPIConfig.cmake" @ONLY)
179-
180-
# ... for both
181180
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/CommonAPIConfigVersion.cmake.in
182181
"${PROJECT_BINARY_DIR}/CommonAPIConfigVersion.cmake" @ONLY)
183182

184183
# Install the CommonAPIConfig.cmake and CommonAPIConfigVersion.cmake
185184
install(FILES
186-
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CommonAPIConfig.cmake"
185+
"${PROJECT_BINARY_DIR}/CommonAPIConfig.cmake"
187186
"${PROJECT_BINARY_DIR}/CommonAPIConfigVersion.cmake"
188187
DESTINATION "${INSTALL_CMAKE_DIR}")
189188

@@ -255,4 +254,3 @@ if(NOT WIN32 AND PKG_CONFIG_FOUND)
255254
endif()
256255

257256
##############################################################################
258-

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
### CommonAPI C++ Core Runtime
22

33
##### Copyright
4-
Copyright (C) 2016-2020, Bayerische Motoren Werke Aktiengesellschaft (BMW AG).
5-
Copyright (C) 2016-2020, GENIVI Alliance, Inc.
4+
Copyright (C) 2016-2023, Bayerische Motoren Werke Aktiengesellschaft (BMW AG).
5+
Copyright (C) 2016-2023, COVESA
66

7-
This file is part of GENIVI Project IPC Common API C++.
8-
Contributions are licensed to the GENIVI Alliance under one or more Contribution License Agreements or MPL 2.0.
7+
This file is part of COVESA Project IPC Common API C++.
8+
Contributions are licensed to the COVESA under one or more Contribution License Agreements or MPL 2.0.
99

1010
##### License
1111
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, you can obtain one at http://mozilla.org/MPL/2.0/.
@@ -14,7 +14,7 @@ This Source Code Form is subject to the terms of the Mozilla Public License, v.
1414
The specification document and the user guide can be found in the CommonAPI documentation directory of the CommonAPI-Tools project as AsciiDoc document. A pdf version can be found at https://github.com/GENIVI/capicxx-core-tools/releases.
1515

1616
##### Further information
17-
https://genivi.github.io/capicxx-core-tools/
17+
https://covesa.github.io/capicxx-core-tools/
1818

1919
##### Build Instructions for Linux
2020

cmake/CommonAPIConfig.cmake.in

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
# Config file for the CommonAPI package
2-
# It defines the following variables
3-
# COMMONAPI_INCLUDE_DIRS - include directories for CommonAPI
2+
# Exports the follwing targets:
3+
# CommonAPI - CMake target for CommonAPI SomeIP
4+
# Additionally, the following variables are defined:
5+
# COMMONAPI_VERSION - The CommonAPI version number
46

57
# Compute paths
68
get_filename_component(COMMONAPI_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
7-
set(COMMONAPI_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@")
89

910
# Our library dependencies (contains definitions for IMPORTED targets)
1011
include("${COMMONAPI_CMAKE_DIR}/CommonAPITargets.cmake")
1112

13+
# Legacy variable, kept for compatibility
14+
get_target_property(COMMONAPI_INCLUDE_DIRS CommonAPI INTERFACE_INCLUDE_DIRECTORIES)
15+
1216
set(COMMONAPI_VERSION @PACKAGE_VERSION@)
1317
set(COMMONAPI_VERSION_STRING "@PACKAGE_VERSION@")

include/CommonAPI/Address.hpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,33 +17,33 @@
1717

1818
namespace CommonAPI {
1919

20-
class Address {
20+
class COMMONAPI_EXPORT_CLASS_EXPLICIT Address {
2121
public:
22-
COMMONAPI_EXPORT Address();
23-
COMMONAPI_EXPORT Address(const std::string &_address);
24-
COMMONAPI_EXPORT Address(const std::string &_domain,
22+
COMMONAPI_METHOD_EXPORT Address();
23+
COMMONAPI_METHOD_EXPORT Address(const std::string &_address);
24+
COMMONAPI_METHOD_EXPORT Address(const std::string &_domain,
2525
const std::string &_interface,
2626
const std::string &_instance);
27-
COMMONAPI_EXPORT Address(const Address &_source);
28-
COMMONAPI_EXPORT virtual ~Address() = default;
27+
COMMONAPI_METHOD_EXPORT Address(const Address &_source);
28+
COMMONAPI_METHOD_EXPORT virtual ~Address() = default;
2929

30-
COMMONAPI_EXPORT Address &operator=(const Address &_other);
30+
COMMONAPI_METHOD_EXPORT Address &operator=(const Address &_other);
3131

32-
COMMONAPI_EXPORT bool operator==(const Address &_other) const;
33-
COMMONAPI_EXPORT bool operator!=(const Address &_other) const;
34-
COMMONAPI_EXPORT bool operator<(const Address &_other) const;
32+
COMMONAPI_METHOD_EXPORT bool operator==(const Address &_other) const;
33+
COMMONAPI_METHOD_EXPORT bool operator!=(const Address &_other) const;
34+
COMMONAPI_METHOD_EXPORT bool operator<(const Address &_other) const;
3535

36-
COMMONAPI_EXPORT std::string getAddress() const;
37-
COMMONAPI_EXPORT void setAddress(const std::string &_address);
36+
COMMONAPI_METHOD_EXPORT std::string getAddress() const;
37+
COMMONAPI_METHOD_EXPORT void setAddress(const std::string &_address);
3838

39-
COMMONAPI_EXPORT const std::string &getDomain() const;
40-
COMMONAPI_EXPORT void setDomain(const std::string &_domain);
39+
COMMONAPI_METHOD_EXPORT const std::string &getDomain() const;
40+
COMMONAPI_METHOD_EXPORT void setDomain(const std::string &_domain);
4141

42-
COMMONAPI_EXPORT const std::string &getInterface() const;
43-
COMMONAPI_EXPORT void setInterface(const std::string &_interface);
42+
COMMONAPI_METHOD_EXPORT const std::string &getInterface() const;
43+
COMMONAPI_METHOD_EXPORT void setInterface(const std::string &_interface);
4444

45-
COMMONAPI_EXPORT const std::string &getInstance() const;
46-
COMMONAPI_EXPORT void setInstance(const std::string &_instance);
45+
COMMONAPI_METHOD_EXPORT const std::string &getInstance() const;
46+
COMMONAPI_METHOD_EXPORT void setInstance(const std::string &_instance);
4747

4848
private:
4949
std::string domain_;

0 commit comments

Comments
 (0)