Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cc95cce

Browse files
committed
Merge branch 'release/4.2'
2 parents 48287dd + 5594f27 commit cc95cce

File tree

80 files changed

+7377
-2587
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+7377
-2587
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/srcCpp*/perftest.*
2+
/srcCpp/perftest_cert_zc*
23
/srcC*/perftest_ZeroCopy*
34
/srcC*/perftestPlugin.*
45
/srcC*/perftestSupport.*
@@ -47,6 +48,7 @@ srcDoc/_build
4748
/srcCpp/perftestApplication.cxx
4849
/srcCpp/perftestApplication.h
4950
/srcCpp/gen/*
51+
/srcCpp/gen_c/*
5052
/srcCpp/perftest_build
5153
/srcCpp/CMakeLists.txt
5254
/srcCpp/custom.cxx
@@ -69,3 +71,5 @@ srcCs/NuGet.Config
6971
srcCs/README*
7072
srcCs/ConnextDDS/GeneratedCode/*
7173
srcDoc/output
74+
.venv
75+
/srcCpp/perftest_micro.tc

.vscode/c_cpp_properties.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,32 @@
123123
"cppStandard": "c++17",
124124
"intelliSenseMode": "clang-x64"
125125
},
126+
{
127+
"name": "Linux Cert (macOS)",
128+
"includePath": [
129+
"${workspaceFolder}/srcCpp",
130+
"${workspaceFolder}/srcCpp/connextDDS",
131+
"${workspaceFolder}/srcCpp/connextDDS/cert",
132+
"${workspaceFolder}/srcCppCommon",
133+
"${env.RTIMEHOME}/include",
134+
"${env.RTIMEHOME}/include/rti_me",
135+
"${env.RTIMEHOME}/include/rti_me/dds_c"
136+
],
137+
"defines": [
138+
"PERFTEST_CERT=1",
139+
"PERFTEST_RTI_MICRO_24x_COMPATIBILITY=1",
140+
"RTI_LANGUAGE_CPP_TRADITIONAL=1",
141+
"RTI_ZEROCOPY_AVAILABLE=1"
142+
],
143+
"macFrameworkPath": [
144+
"/System/Library/Frameworks",
145+
"/Library/Frameworks"
146+
],
147+
"compilerPath": "/usr/bin/clang",
148+
"cStandard": "c11",
149+
"cppStandard": "c++17",
150+
"intelliSenseMode": "clang-x64"
151+
},
126152
{
127153
"name": "Micro (OSX)",
128154
"includePath": [

build.bat

Lines changed: 108 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
@echo off
32
setlocal EnableDelayedExpansion
43

@@ -28,6 +27,7 @@ set MICRO_UNBOUNDED_SEQUENCE_SIZE=1048576
2827
set BUILD_CPP=1
2928
set BUILD_CPP11=1
3029
set BUILD_JAVA=1
30+
set USER_RTIDDSGEN_EXECUTABLE=""
3131
set BUILD_CS=0
3232

3333
@REM # If this value is != 0, then it means the user specified specific APIS to be
@@ -46,7 +46,6 @@ set RELEASE_DEBUG=release
4646
set STATIC_DYNAMIC=static
4747
set USE_SECURE_LIBS=0
4848
set USE_LW_SECURE_LIBS=0
49-
set LEGACY_DD_IMPL=0
5049

5150
@REM Starting with 5.2.6 (rtiddsgen 2.3.6) the name of the solutions is different
5251
set rtiddsgen_version_number_new_solution_name=2.3.6
@@ -74,6 +73,7 @@ set "custom_idl_file=%custom_type_folder%\custom.idl"
7473
@REM #3.0.0 -- 3 We just need the Major first value of the version.
7574
set flatdata_ddsgen_version=3
7675
set FLATDATA_AVAILABLE=0
76+
set rtiddsgen_extra_options=
7777
::------------------------------------------------------------------------------
7878

7979
@REM # Initial message
@@ -145,8 +145,6 @@ if NOT "%1"=="" (
145145
SET RELEASE_DEBUG=debug
146146
) ELSE if "%1"=="--dynamic" (
147147
SET STATIC_DYNAMIC=dynamic
148-
) ELSE if "%1"=="--legacy-DynamicData" (
149-
SET LEGACY_DD_IMPL=1
150148
) ELSE if "%1"=="--secure" (
151149
SET USE_SECURE_LIBS=1
152150
) ELSE if "%1"=="--lightWeightSecure" (
@@ -221,6 +219,9 @@ if NOT "%1"=="" (
221219
exit /b 1
222220
)
223221
SHIFT
222+
) ELSE if "%1"=="--rtiddsgen-path" (
223+
SET "USER_RTIDDSGEN_EXECUTABLE=%2"
224+
SHIFT
224225
) ELSE (
225226
echo [ERROR]: Unknown argument "%1"
226227
call:help
@@ -230,6 +231,11 @@ if NOT "%1"=="" (
230231
GOTO :parse_arguments
231232
)
232233

234+
if defined VSDEVCMD (
235+
echo [INFO]: Sourcing Visual Studio environment from "!VSDEVCMD!"
236+
call "!VSDEVCMD!"
237+
)
238+
233239
::------------------------------------------------------------------------------
234240
if "x!architecture!" == "x" (
235241
echo [ERROR]: The platform argument is missing.
@@ -337,10 +343,14 @@ if !BUILD_MICRO! == 1 (
337343
) else (
338344
@REM # This calls the function in charge of getting the name of the solution for C++
339345
@REM # given the architecture.
340-
echo .
341346
call::get_solution_name
342347

343348
set "rtiddsgen_executable=!NDDSHOME!/bin/rtiddsgen.bat"
349+
350+
if not !USER_RTIDDSGEN_EXECUTABLE!=="" (
351+
echo [INFO]: Using user-provided rtiddsgen executable: !USER_RTIDDSGEN_EXECUTABLE!
352+
set "rtiddsgen_executable=!USER_RTIDDSGEN_EXECUTABLE!"
353+
)
344354
)
345355

346356
::------------------------------------------------------------------------------
@@ -398,11 +408,6 @@ if !BUILD_CPP! == 1 (
398408
)
399409
)
400410

401-
if !LEGACY_DD_IMPL! == 1 (
402-
echo [INFO]: Allow the use of both legacy and new Dynamic Data Impl.
403-
set "ADDITIONAL_DEFINES=!ADDITIONAL_DEFINES! RTI_LEGACY_DD_IMPL"
404-
)
405-
406411
set "ADDITIONAL_DEFINES=PERFTEST_RTI_PRO RTI_LANGUAGE_CPP_TRADITIONAL RTI_WIN32"
407412

408413
if !USE_SECURE_LIBS! == 1 (
@@ -435,11 +440,19 @@ if !BUILD_CPP! == 1 (
435440
)
436441
)
437442

438-
REM If the SSL_VERSION is empty and the $RTI_CRYPTOHOME is empty too
443+
REM If the SSL_VERSION is empty and the $RTI_OPENSSLHOME is empty too
439444
REM we need to be creative. If we set the $SSL_VERSION before, we will
440445
REM not enter here.
441446
if "!RTI_OPENSSLHOME!"=="" (
442447
call :crypto_path_calculation
448+
) else (
449+
if not exist "%RTI_OPENSSLHOME%\" (
450+
echo [ERROR] %RTI_OPENSSLHOME% is not a folder.
451+
exit /b -1
452+
)
453+
454+
call :get_rti_security_lib_path_for_crypto_path
455+
echo [INFO] ndds_security_crypto_lib_folder = "!ndds_security_crypto_lib_folder!"
443456
)
444457

445458
if "%USE_LW_SECURE_LIBS%"=="1" (
@@ -448,8 +461,9 @@ if !BUILD_CPP! == 1 (
448461
set additional_rti_libs=nddssecurity !additional_rti_libs!
449462
)
450463

451-
set rtiddsgen_extra_options=-additionalLibraries "crypt32 libcrypto libssl"
452-
set rtiddsgen_extra_options=!rtiddsgen_extra_options! -additionalLibraryPaths "!RTI_OPENSSLHOME!\static_!RELEASE_DEBUG!\lib"
464+
set rtiddsgen_extra_options=!rtiddsgen_extra_options! -additionalLibraries "crypt32 libcrypto libssl"
465+
set rtiddsgen_extra_options=!rtiddsgen_extra_options! -additionalLibraryPaths "!RTI_OPENSSLHOME!\static_!RELEASE_DEBUG!\lib !ndds_security_crypto_lib_folder!"
466+
echo [INFO] rtiddsgen_extra_options=!rtiddsgen_extra_options!
453467
echo [INFO] Using security plugin. Linking Statically.
454468
)
455469
set "additional_header_files=PerftestSecurity.h !additional_header_files!"
@@ -585,7 +599,7 @@ if !BUILD_CPP! == 1 (
585599
call::clean_copied_files
586600

587601
if "x!STATIC_DYNAMIC!" == "xdynamic" (
588-
echo [INFO]: Code compiled dynamically, Add "NDDSHOME/lib/%platform%"
602+
echo [INFO]: Code compiled dynamically, Add "NDDSHOME/lib/%architecture%"
589603
if !USE_SECURE_LIBS! == 1 (
590604
echo and <OPENSSL_HOME>\!RELEASE_DEBUG!\bin
591605
)
@@ -609,7 +623,7 @@ if !BUILD_CPP11! == 1 (
609623
set "LWS_TAG=Lightweight "
610624
)
611625

612-
echo [INFO_TAG] Using RTI !LWS_TAG!Security Libraries
626+
echo [INFO] Using RTI !LWS_TAG!Security Libraries
613627

614628
set "ADDITIONAL_DEFINES=!ADDITIONAL_DEFINES! RTI_SECURE_PERFTEST"
615629

@@ -633,11 +647,20 @@ if !BUILD_CPP11! == 1 (
633647
)
634648
)
635649

636-
REM If the SSL_VERSION is empty and the $RTI_CRYPTOHOME is empty too
650+
REM If the SSL_VERSION is empty and the $RTI_OPENSSLHOME is empty too
637651
REM we need to be creative. If we set the $SSL_VERSION before, we will
638652
REM not enter here.
639653
if "!RTI_OPENSSLHOME!"=="" (
640654
call :crypto_path_calculation
655+
) else (
656+
if not exist "%RTI_OPENSSLHOME%\" (
657+
echo [ERROR] %RTI_OPENSSLHOME% is not a folder.
658+
exit /b -1
659+
)
660+
661+
call :get_rti_security_lib_path_for_crypto_path
662+
echo [INFO] ndds_security_crypto_lib_folder = "!ndds_security_crypto_lib_folder!"
663+
echo [INFO] rtiddsgen_extra_options=!rtiddsgen_extra_options!
641664
)
642665

643666
if "%USE_LW_SECURE_LIBS%"=="1" (
@@ -647,7 +670,8 @@ if !BUILD_CPP11! == 1 (
647670
)
648671

649672
set rtiddsgen_extra_options=-additionalLibraries "crypt32 libcrypto libssl"
650-
set rtiddsgen_extra_options=!rtiddsgen_extra_options! -additionalLibraryPaths "!RTI_OPENSSLHOME!\static_!RELEASE_DEBUG!\lib"
673+
set rtiddsgen_extra_options=!rtiddsgen_extra_options! -additionalLibraryPaths "!RTI_OPENSSLHOME!\static_!RELEASE_DEBUG!\lib !ndds_security_crypto_lib_folder!"
674+
echo [INFO] rtiddsgen_extra_options=!rtiddsgen_extra_options!
651675
echo [INFO] Using security plugin. Linking Statically.
652676
)
653677
)
@@ -770,7 +794,7 @@ if !BUILD_CPP11! == 1 (
770794
call::clean_copied_files
771795

772796
if "x!STATIC_DYNAMIC!" == "xdynamic" (
773-
echo [INFO]: Code compiled dynamically, Add "NDDSHOME/lib/%platform%"
797+
echo [INFO]: Code compiled dynamically, Add "NDDSHOME/lib/%architecture%"
774798
if !USE_SECURE_LIBS! == 1 (
775799
echo and <OPENSSL_HOME>\!RELEASE_DEBUG!\bin
776800
)
@@ -1095,11 +1119,9 @@ goto:EOF
10951119
GOTO:EOF
10961120

10971121
:get_ddsgen_version
1098-
for /F "delims=" %%i in ('"%NDDSHOME%\bin\rtiddsgen.bat" -version ^| findstr /R /C:rtiddsgen') do (
1099-
set version_line=%%i
1122+
for /F "tokens=5 delims= " %%i in ('call "%NDDSHOME%\bin\rtiddsgen.bat" -version ^| findstr /R /C:"rtiddsgen version"') do (
1123+
set version_string=%%i
11001124
)
1101-
set version_string=%version_line:~49,6%
1102-
11031125
for /F "tokens=1,2,3 delims=." %%a in ("%version_string%") do (
11041126
set Major=%%a
11051127
set Minor=%%b
@@ -1109,26 +1131,68 @@ GOTO:EOF
11091131
set /a version_number=%Major%%Minor%%Revision%
11101132
GOTO:EOF
11111133

1134+
:get_rti_security_lib_path_for_crypto_path
1135+
1136+
set "ssl_version=openssl-3"
1137+
echo %RTI_OPENSSLHOME% | findstr /C:"%ssl_version%" >nul
1138+
if not errorlevel 1 (
1139+
call :rti_security_lib_path_calculation %ssl_version%
1140+
goto :eof
1141+
)
1142+
1143+
set "ssl_version=openssl-1"
1144+
echo %RTI_OPENSSLHOME% | findstr /C:"%ssl_version%" >nul
1145+
if not errorlevel 1 (
1146+
call :rti_security_lib_path_calculation %ssl_version%
1147+
goto :eof
1148+
)
1149+
1150+
set "ssl_version=wolfssl-"
1151+
echo %RTI_OPENSSLHOME% | findstr /C:"%ssl_version%" >nul
1152+
if not errorlevel 1 (
1153+
call :rti_security_lib_path_calculation %ssl_version%
1154+
goto :eof
1155+
)
1156+
1157+
GOTO:EOF
1158+
11121159
:crypto_path_calculation
1160+
echo.
1161+
echo [INFO] Finding crypto libraries to use:
11131162

11141163
set "ssl_version=openssl-3"
11151164
call :find_ssl_libraries %ssl_version%
11161165
if not "!RTI_OPENSSLHOME!" == "" (
1166+
call :rti_security_lib_path_calculation %ssl_version%
1167+
set "USE_OPENSSL=1"
1168+
set "USE_OPENSSL=%USE_OPENSSL%"
11171169
exit /b
11181170
)
11191171

11201172
set "ssl_version=openssl-1"
11211173
call :find_ssl_libraries %ssl_version%
1122-
if not "!RTI_OPENSSLHOME!" == "" (
1174+
if not "!RTI_OPENSSLHOME!"=="" (
1175+
call :rti_security_lib_path_calculation %ssl_version%
1176+
set "USE_OPENSSL=1"
1177+
set "USE_OPENSSL=%USE_OPENSSL%"
1178+
exit /b
1179+
)
1180+
1181+
set "ssl_version=wolfssl-"
1182+
call :find_ssl_libraries %ssl_version%
1183+
if not "!RTI_OPENSSLHOME!"=="" (
1184+
call :rti_security_lib_path_calculation %ssl_version%
1185+
set "USE_OPENSSL=0"
1186+
set "USE_OPENSSL=%USE_OPENSSL%"
11231187
exit /b
11241188
)
11251189

11261190
REM Well, we tried...
1127-
echo.
1128-
echo [ERROR] We couldn't find Any SSL libraries in your Connext installation folder.
1129-
echo You need to provide us with a path to a crypto library. Set the OpenSSL
1130-
echo home path by using the --openssl-home option.
1131-
exit /b
1191+
echo [ERROR] We couldn't find any SSL libraries in your Connext installation folder.
1192+
echo You need to provide a path to a crypto library.
1193+
echo Set either the OpenSSL home path using --openssl-home,
1194+
echo or the WolfSSL home path using --wolfssl-home.
1195+
exit /b -1
11321196

11331197
:find_ssl_libraries
11341198

@@ -1155,6 +1219,18 @@ GOTO:EOF
11551219
)
11561220
exit /b
11571221

1222+
:rti_security_lib_path_calculation
1223+
set "find_pattern=%~1"
1224+
1225+
set "full_path="
1226+
call :get_absolute_folder_path "%NDDSHOME%\lib\%architecture%\%find_pattern%"
1227+
if not "!full_path!"=="" (
1228+
set "ndds_security_crypto_lib_folder=!full_path!"
1229+
echo [INFO] Using the Connext Security libs from: "!ndds_security_crypto_lib_folder!"
1230+
)
1231+
1232+
set "ndds_security_crypto_lib_folder=%ndds_security_crypto_lib_folder%"
1233+
GOTO:EOF
11581234

11591235
:get_absolute_folder_path
11601236

@@ -1247,6 +1323,10 @@ GOTO:EOF
12471323
echo. --flatData-max-size size Specify the maximum bounded size in bytes
12481324
echo. for sequences when using FlatData language
12491325
echo. binding. Default 10MB
1326+
echo. --rtiddsgen-path <path> Use a specific path for the rtiddsgen tool,
1327+
echo. overriding NDDSHOME, RTIMEHOME, etc.
1328+
echo. If this parameter is not specified, the
1329+
echo. default logic in this script will be used.
12501330
echo. --help -h Display this message.
12511331
echo[
12521332
echo ================================================================================

0 commit comments

Comments
 (0)