Skip to content

Commit 263e648

Browse files
committed
windows build
1 parent aedd048 commit 263e648

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

libxtracfg/c/native-image/static-compiler-windows.bat

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ if not exist %LOG_PATH% mkdir %LOG_PATH%
3434
echo Working directory: %CD% > %LOG_FILE%
3535
echo Output path: %OUTPUT_PATH% >> %LOG_FILE%
3636
echo Library name: %LIB_NAME% >> %LOG_FILE%
37+
echo Java home: %JAVA_HOME% >> %LOG_FILE%
3738

3839
echo ===================================================== >> %LOG_FILE%
3940
echo SHARED LIBRARY >> %LOG_FILE%
@@ -52,8 +53,17 @@ for %%P in (%*) do (
5253
echo %%P | findstr /R /C:"^C:.*\.lib" 1>nul
5354
if !errorlevel!==0 (
5455
echo *** >> %LOG_FILE%
55-
set LIBS_EXT=!LIBS_EXT! %%P
56+
echo %%P | findstr /R /C:"\\jvm\.lib" 1>nul
57+
if !errorlevel!==0 (
58+
set "TMP=%%P"
59+
set "TMP=!TMP:svm\clibraries\windows-amd64=!"
60+
set "LIBS_EXT=!LIBS_EXT! !TMP!"
61+
echo (replaced svm\clibraries\windows-amd64) >> %LOG_FILE%
62+
) else (
63+
set "LIBS_EXT=!LIBS_EXT! %%P"
64+
)
5665
)
66+
5767
)
5868
echo !LIBS_EXT! >> %LOG_FILE%
5969

@@ -64,6 +74,6 @@ REM To create a static library on Windows we need to call lib.exe input.obj /OUT
6474
REM We don't want to overwrite the .lib needed to compile against the .dll, so
6575
REM we append "_s" to indicate that it is a static library.
6676
if not exist %OUTPUT_PATH% mkdir %OUTPUT_PATH%
67-
set LIB_ARGS=%LIB_NAME%.obj %JAVA_HOME%/lib/jvm.lib !LIBS_EXT! /OUT:%OUTPUT_PATH%\%LIB_NAME%_static.lib
77+
set LIB_ARGS=%LIB_NAME%.obj !LIBS_EXT! /OUT:%OUTPUT_PATH%\%LIB_NAME%_static.lib
6878
echo lib.exe %LIB_ARGS% >> %LOG_FILE%
6979
cmd /c lib.exe %LIB_ARGS%

0 commit comments

Comments
 (0)