1
-
2
1
@ echo off
3
2
setlocal EnableDelayedExpansion
4
3
@@ -28,6 +27,7 @@ set MICRO_UNBOUNDED_SEQUENCE_SIZE=1048576
28
27
set BUILD_CPP = 1
29
28
set BUILD_CPP11 = 1
30
29
set BUILD_JAVA = 1
30
+ set USER_RTIDDSGEN_EXECUTABLE = " "
31
31
set BUILD_CS = 0
32
32
33
33
@ REM # If this value is != 0, then it means the user specified specific APIS to be
@@ -46,7 +46,6 @@ set RELEASE_DEBUG=release
46
46
set STATIC_DYNAMIC = static
47
47
set USE_SECURE_LIBS = 0
48
48
set USE_LW_SECURE_LIBS = 0
49
- set LEGACY_DD_IMPL = 0
50
49
51
50
@ REM Starting with 5.2.6 (rtiddsgen 2.3.6) the name of the solutions is different
52
51
set rtiddsgen_version_number_new_solution_name = 2.3.6
@@ -74,6 +73,7 @@ set "custom_idl_file=%custom_type_folder%\custom.idl"
74
73
@ REM #3.0.0 -- 3 We just need the Major first value of the version.
75
74
set flatdata_ddsgen_version = 3
76
75
set FLATDATA_AVAILABLE = 0
76
+ set rtiddsgen_extra_options =
77
77
:: ------------------------------------------------------------------------------
78
78
79
79
@ REM # Initial message
@@ -145,8 +145,6 @@ if NOT "%1"=="" (
145
145
SET RELEASE_DEBUG = debug
146
146
) ELSE if " %1 " == " --dynamic" (
147
147
SET STATIC_DYNAMIC = dynamic
148
- ) ELSE if " %1 " == " --legacy-DynamicData" (
149
- SET LEGACY_DD_IMPL = 1
150
148
) ELSE if " %1 " == " --secure" (
151
149
SET USE_SECURE_LIBS = 1
152
150
) ELSE if " %1 " == " --lightWeightSecure" (
@@ -221,6 +219,9 @@ if NOT "%1"=="" (
221
219
exit /b 1
222
220
)
223
221
SHIFT
222
+ ) ELSE if " %1 " == " --rtiddsgen-path" (
223
+ SET " USER_RTIDDSGEN_EXECUTABLE = %2 "
224
+ SHIFT
224
225
) ELSE (
225
226
echo [ERROR]: Unknown argument " %1 "
226
227
call :help
@@ -230,6 +231,11 @@ if NOT "%1"=="" (
230
231
GOTO :parse_arguments
231
232
)
232
233
234
+ if defined VSDEVCMD (
235
+ echo [INFO]: Sourcing Visual Studio environment from " !VSDEVCMD! "
236
+ call " !VSDEVCMD! "
237
+ )
238
+
233
239
:: ------------------------------------------------------------------------------
234
240
if " x!architecture! " == " x" (
235
241
echo [ERROR]: The platform argument is missing.
@@ -337,10 +343,14 @@ if !BUILD_MICRO! == 1 (
337
343
) else (
338
344
@ REM # This calls the function in charge of getting the name of the solution for C++
339
345
@ REM # given the architecture.
340
- echo .
341
346
call ::get_solution_name
342
347
343
348
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
+ )
344
354
)
345
355
346
356
:: ------------------------------------------------------------------------------
@@ -398,11 +408,6 @@ if !BUILD_CPP! == 1 (
398
408
)
399
409
)
400
410
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
-
406
411
set " ADDITIONAL_DEFINES = PERFTEST_RTI_PRO RTI_LANGUAGE_CPP_TRADITIONAL RTI_WIN32"
407
412
408
413
if !USE_SECURE_LIBS! == 1 (
@@ -435,11 +440,19 @@ if !BUILD_CPP! == 1 (
435
440
)
436
441
)
437
442
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
439
444
REM we need to be creative. If we set the $SSL_VERSION before, we will
440
445
REM not enter here.
441
446
if " !RTI_OPENSSLHOME! " == " " (
442
447
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! "
443
456
)
444
457
445
458
if " %USE_LW_SECURE_LIBS% " == " 1" (
@@ -448,8 +461,9 @@ if !BUILD_CPP! == 1 (
448
461
set additional_rti_libs = nddssecurity !additional_rti_libs!
449
462
)
450
463
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!
453
467
echo [INFO] Using security plugin. Linking Statically.
454
468
)
455
469
set " additional_header_files = PerftestSecurity.h !additional_header_files! "
@@ -585,7 +599,7 @@ if !BUILD_CPP! == 1 (
585
599
call ::clean_copied_files
586
600
587
601
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 % "
589
603
if !USE_SECURE_LIBS! == 1 (
590
604
echo and < OPENSSL_HOME> \!RELEASE_DEBUG! \bin
591
605
)
@@ -609,7 +623,7 @@ if !BUILD_CPP11! == 1 (
609
623
set " LWS_TAG = Lightweight "
610
624
)
611
625
612
- echo [INFO_TAG ] Using RTI !LWS_TAG! Security Libraries
626
+ echo [INFO ] Using RTI !LWS_TAG! Security Libraries
613
627
614
628
set " ADDITIONAL_DEFINES = !ADDITIONAL_DEFINES! RTI_SECURE_PERFTEST"
615
629
@@ -633,11 +647,20 @@ if !BUILD_CPP11! == 1 (
633
647
)
634
648
)
635
649
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
637
651
REM we need to be creative. If we set the $SSL_VERSION before, we will
638
652
REM not enter here.
639
653
if " !RTI_OPENSSLHOME! " == " " (
640
654
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!
641
664
)
642
665
643
666
if " %USE_LW_SECURE_LIBS% " == " 1" (
@@ -647,7 +670,8 @@ if !BUILD_CPP11! == 1 (
647
670
)
648
671
649
672
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!
651
675
echo [INFO] Using security plugin. Linking Statically.
652
676
)
653
677
)
@@ -770,7 +794,7 @@ if !BUILD_CPP11! == 1 (
770
794
call ::clean_copied_files
771
795
772
796
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 % "
774
798
if !USE_SECURE_LIBS! == 1 (
775
799
echo and < OPENSSL_HOME> \!RELEASE_DEBUG! \bin
776
800
)
@@ -1095,11 +1119,9 @@ goto:EOF
1095
1119
GOTO :EOF
1096
1120
1097
1121
: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
1100
1124
)
1101
- set version_string = %version_line:~49 ,6 %
1102
-
1103
1125
for /F " tokens=1,2,3 delims=." %%a in (" %version_string% " ) do (
1104
1126
set Major = %%a
1105
1127
set Minor = %%b
@@ -1109,26 +1131,68 @@ GOTO:EOF
1109
1131
set /a version_number = %Major%% Minor%% Revision%
1110
1132
GOTO :EOF
1111
1133
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
+
1112
1159
:crypto_path_calculation
1160
+ echo .
1161
+ echo [INFO] Finding crypto libraries to use:
1113
1162
1114
1163
set " ssl_version = openssl-3"
1115
1164
call :find_ssl_libraries %ssl_version%
1116
1165
if not " !RTI_OPENSSLHOME! " == " " (
1166
+ call :rti_security_lib_path_calculation %ssl_version%
1167
+ set " USE_OPENSSL = 1"
1168
+ set " USE_OPENSSL = %USE_OPENSSL% "
1117
1169
exit /b
1118
1170
)
1119
1171
1120
1172
set " ssl_version = openssl-1"
1121
1173
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% "
1123
1187
exit /b
1124
1188
)
1125
1189
1126
1190
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
1132
1196
1133
1197
:find_ssl_libraries
1134
1198
@@ -1155,6 +1219,18 @@ GOTO:EOF
1155
1219
)
1156
1220
exit /b
1157
1221
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
1158
1234
1159
1235
:get_absolute_folder_path
1160
1236
@@ -1247,6 +1323,10 @@ GOTO:EOF
1247
1323
echo . --flatData-max-size size Specify the maximum bounded size in bytes
1248
1324
echo . for sequences when using FlatData language
1249
1325
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.
1250
1330
echo . --help -h Display this message.
1251
1331
echo[
1252
1332
echo ================================================================================
0 commit comments