mirror of
https://github.com/crystalidea/qt-build-tools.git
synced 2024-11-21 18:24:27 +08:00
qt 6.7.2 build tools
This commit is contained in:
parent
197da8ca95
commit
8eb2eccdd0
11
.editorconfig
Normal file
11
.editorconfig
Normal file
@ -0,0 +1,11 @@
|
||||
# EditorConfig is awesome: https://EditorConfig.org
|
||||
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
# Unix-style newlines with a newline ending every file
|
||||
[*]
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 4
|
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@ -0,0 +1 @@
|
||||
* text=auto
|
@ -12,8 +12,13 @@ $current_dir =~ s#/#\\#g; # convert separators to Windows-style
|
||||
$prefix_dir =~ s#/#\\#g; # convert separators to Windows-style
|
||||
|
||||
my $arch = $ARGV[0];
|
||||
my $install_dir = $ARGV[1];
|
||||
|
||||
$arch = "amd64" if ($arch eq ''); # amd64 is nothing is specified, can be x86
|
||||
die "Please specify architecture (x86 or amd64)" if ($arch ne "x86" && $arch ne "amd64"); # die if user specified anything except x86 or amd64
|
||||
die "Error: Please specify architecture (x86 or amd64)" if ($arch ne "x86" && $arch ne "amd64"); # die if user specified anything except x86 or amd64
|
||||
die "Error: Please specify install dir as second parameter" if (!$install_dir);
|
||||
|
||||
die "Error: istall dir $install_dir already exists" if (-d $install_dir);
|
||||
|
||||
my $openssl_version = "3.0.13"; # supported until 7th September 2026
|
||||
my $openssl_download = "https://www.openssl.org/source/openssl-$openssl_version.tar.gz";
|
||||
@ -79,7 +84,7 @@ foreach (split(/\s/, $skipped_modules)) {
|
||||
$skipped_modules_cmd .= "-skip $_ ";
|
||||
}
|
||||
|
||||
printLineToBat ("..\\configure -prefix C:\\qt6 -opensource -debug-and-release -confirm-license -opengl desktop -nomake tests -nomake examples $skipped_modules_cmd -openssl-linked -- -DOPENSSL_ROOT_DIR=\"$openssl_dir\\build\" -DOPENSSL_INCLUDE_DIR=\"$openssl_dir\\build\\include\" -DOPENSSL_USE_STATIC_LIBS=ON");
|
||||
printLineToBat ("..\\configure -prefix $install_dir -opensource -debug-and-release -confirm-license -opengl desktop -nomake tests -nomake examples $skipped_modules_cmd -openssl-linked -- -DOPENSSL_ROOT_DIR=\"$openssl_dir\\build\" -DOPENSSL_INCLUDE_DIR=\"$openssl_dir\\build\\include\" -DOPENSSL_USE_STATIC_LIBS=ON");
|
||||
|
||||
printLineToBat ("goto :EOF");
|
||||
|
||||
|
BIN
6.7.2/_tools/7z.dll
Normal file
BIN
6.7.2/_tools/7z.dll
Normal file
Binary file not shown.
BIN
6.7.2/_tools/7z.exe
Normal file
BIN
6.7.2/_tools/7z.exe
Normal file
Binary file not shown.
BIN
6.7.2/_tools/cmake.7z
Normal file
BIN
6.7.2/_tools/cmake.7z
Normal file
Binary file not shown.
BIN
6.7.2/_tools/ninja.exe
Normal file
BIN
6.7.2/_tools/ninja.exe
Normal file
Binary file not shown.
BIN
6.7.2/_tools/openssl-3.0.13-WIN32.7z
Normal file
BIN
6.7.2/_tools/openssl-3.0.13-WIN32.7z
Normal file
Binary file not shown.
BIN
6.7.2/_tools/openssl-3.0.13-WIN64A.7z
Normal file
BIN
6.7.2/_tools/openssl-3.0.13-WIN64A.7z
Normal file
Binary file not shown.
BIN
6.7.2/_tools/wget.exe
Normal file
BIN
6.7.2/_tools/wget.exe
Normal file
Binary file not shown.
112
6.7.2/compile_win.pl
Normal file
112
6.7.2/compile_win.pl
Normal file
@ -0,0 +1,112 @@
|
||||
use strict;
|
||||
use Cwd;
|
||||
use Path::Tiny;
|
||||
use IPC::Cmd qw[can_run run];
|
||||
|
||||
# check requirements:
|
||||
die "Cannot proceed without the '_tools' folder'" if (!-e "_tools");
|
||||
|
||||
my $current_dir = getcwd;
|
||||
my $prefix_dir = path($current_dir)->parent(1); # one level up
|
||||
$current_dir =~ s#/#\\#g; # convert separators to Windows-style
|
||||
$prefix_dir =~ s#/#\\#g; # convert separators to Windows-style
|
||||
|
||||
my $arch = $ARGV[0];
|
||||
my $install_dir = $ARGV[1];
|
||||
|
||||
$arch = "amd64" if ($arch eq ''); # amd64 is nothing is specified, can be x86
|
||||
die "Error: Please specify architecture (x86 or amd64)" if ($arch ne "x86" && $arch ne "amd64"); # die if user specified anything except x86 or amd64
|
||||
die "Error: Please specify install dir as second parameter" if (!$install_dir);
|
||||
|
||||
die "Error: istall dir $install_dir already exists" if (-d $install_dir);
|
||||
|
||||
my $openssl_version = "3.0.13"; # supported until 7th September 2026
|
||||
my $openssl_download = "https://www.openssl.org/source/openssl-$openssl_version.tar.gz";
|
||||
my $openssl_arch = $arch eq "amd64" ? "WIN64A" : "WIN32";
|
||||
my $openssl_dir = "$current_dir\\openssl-$openssl_version-$openssl_arch";
|
||||
my $openssl_7z = "openssl-$openssl_version-$openssl_arch.7z";
|
||||
|
||||
# will create a batch file
|
||||
|
||||
my $batfile = 'compile_win.bat';
|
||||
|
||||
open BAT, '>', $batfile;
|
||||
|
||||
printLineToBat ("SET PATH=%PATH%;%cd%\\_tools;%cd%\\_tools\\cmake\\bin"); # add folders to the path for 7z, wget, cmake, etc
|
||||
printLineToBat ("CALL \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat\" $arch");
|
||||
printLineToBat ("SET _ROOT=%cd%");
|
||||
printLineToBat ("SET PATH=%_ROOT%\\qtbase\\bin;%_ROOT%\\gnuwin32\\bin;%PATH%"); # http://doc.qt.io/qt-5/windows-building.html
|
||||
printLineToBat ("SET OPENSSL_LIBS=-lUser32 -lAdvapi32 -lGdi32 -llibcrypto -llibssl");
|
||||
|
||||
printLineToBat ("cd _tools");
|
||||
printLineToBat ("7z x cmake.7z -aoa -y");
|
||||
|
||||
printLineToBat ("7z x $openssl_7z -o$openssl_dir -y") if (-e "_tools\\$openssl_7z");
|
||||
printLineToBat ("cd ..");
|
||||
|
||||
printLineToBat ("IF EXIST qt6-build GOTO SECOND_STEP");
|
||||
printLineToBat ("mkdir qt6-build");
|
||||
printLineToBat (":SECOND_STEP");
|
||||
printLineToBat ("cd qt6-build");
|
||||
|
||||
printLineToBat ("if \"%~1\"==\"step2\" goto step2");
|
||||
|
||||
# step1: compile openssl and do configure. For some reason, can't continue script execution after configure, have to make step2
|
||||
printLineToBat ("IF EXIST $openssl_dir\\build GOTO OPENSSL_ALREAD_COMPILED");
|
||||
printLineToBat ("wget --no-check-certificate $openssl_download");
|
||||
printLineToBat ("7z x openssl-$openssl_version.tar.gz");
|
||||
printLineToBat ("7z x openssl-$openssl_version.tar -o$openssl_dir -y");
|
||||
printLineToBat ("mv $openssl_dir\\openssl-$openssl_version\\* $openssl_dir");
|
||||
printLineToBat ("rmdir $openssl_dir\\openssl-$openssl_version"); # empty now
|
||||
printLineToBat ("rm openssl-$openssl_version.tar.gz");
|
||||
printLineToBat ("rm openssl-$openssl_version.tar");
|
||||
printLineToBat ("cd $openssl_dir"); # go to openssl dir
|
||||
printLineToBat ("perl Configure VC-$openssl_arch no-asm no-shared no-tests --prefix=%cd%\\build --openssldir=%cd%\\build");
|
||||
printLineToBat ("nmake");
|
||||
printLineToBat ("nmake install");
|
||||
# do some clean up:
|
||||
printLineToBat ("rm test\\*.exe");
|
||||
printLineToBat ("rm test\\*.pdb");
|
||||
printLineToBat ("rm test\\*.obj");
|
||||
printLineToBat ("del /s /f /q out32");
|
||||
printLineToBat ("del /s /f /q out32.dbg");
|
||||
printLineToBat ("cd .."); # go back to qtbase
|
||||
|
||||
printLineToBat (":OPENSSL_ALREAD_COMPILED");
|
||||
|
||||
# openssl: see https://bugreports.qt.io/browse/QTBUG-65501
|
||||
|
||||
my $skipped_modules = "qt3d qtactiveqt qtcharts qtcoap qtconnectivity qtdatavis3d qtdeclarative qtdoc qtlottie qtmqtt qtmultimedia qtnetworkauth qtopcua qtpositioning qtquick3d qtquicktimeline qtremoteobjects qtscxml qtsensors qtserialbus qtserialport qtshadertools qtsvg qttranslations qtvirtualkeyboard qtwayland qtwebchannel qtwebengine qtwebsockets qtwebview";
|
||||
|
||||
my $skipped_modules_cmd;
|
||||
|
||||
foreach (split(/\s/, $skipped_modules)) {
|
||||
$skipped_modules_cmd .= "-skip $_ ";
|
||||
}
|
||||
|
||||
printLineToBat ("..\\configure -prefix $install_dir -opensource -debug-and-release -confirm-license -opengl desktop -nomake tests -nomake examples $skipped_modules_cmd -openssl-linked -- -DOPENSSL_ROOT_DIR=\"$openssl_dir\\build\" -DOPENSSL_INCLUDE_DIR=\"$openssl_dir\\build\\include\" -DOPENSSL_USE_STATIC_LIBS=ON");
|
||||
|
||||
printLineToBat ("goto :EOF");
|
||||
|
||||
# step 2:
|
||||
printLineToBat (":step2");
|
||||
|
||||
printLineToBat ("cmake --build . --parallel");
|
||||
printLineToBat ("cmake --install . --config Release");
|
||||
printLineToBat ("cmake --install . --config Debug");
|
||||
|
||||
# clean up
|
||||
printLineToBat ("cd .."); # since we're now in 'qt6-build' for some reason
|
||||
printLineToBat ("rmdir qt6-build /s /q");
|
||||
|
||||
close BAT;
|
||||
|
||||
system ($batfile);
|
||||
system ("$batfile step2");
|
||||
|
||||
system ("pause");
|
||||
|
||||
sub printLineToBat
|
||||
{
|
||||
print BAT "$_[0]\n";
|
||||
}
|
1
6.7.2/compile_win_x64.bat
Normal file
1
6.7.2/compile_win_x64.bat
Normal file
@ -0,0 +1 @@
|
||||
perl compile_win.pl amd64 C:\qt6_x64
|
1
6.7.2/compile_win_x86.bat
Normal file
1
6.7.2/compile_win_x86.bat
Normal file
@ -0,0 +1 @@
|
||||
perl compile_win.pl x86 C:\qt6
|
Loading…
Reference in New Issue
Block a user