syncqt: fix injected headers outside qtbase in non-prefix builds
in non-prefix configs, one has to differentiate between the module's own build dir and qtbase's build dir, because the forwarding headers are placed in -outdir under include/, while the actual headers end up in the real build dir under src/. Change-Id: I1d8ac904556b354bd113995316ba11dd6560a70d Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
a060bf9673
commit
ede6c44756
@ -76,6 +76,7 @@ sub normalizePath {
|
||||
# set output basedir to be where ever syncqt is run from
|
||||
our $out_basedir = getcwd();
|
||||
normalizePath(\$out_basedir);
|
||||
our $build_basedir = $out_basedir;
|
||||
our $basedir;
|
||||
|
||||
# Make sure we use Windows line endings for chomp and friends on Windows.
|
||||
@ -128,6 +129,7 @@ sub showUsage
|
||||
print " -showonly Show action but not perform (default: " . ($showonly ? "yes" : "no") . ")\n";
|
||||
print " -minimal Do not create CamelCase headers (default: " . ($minimal ? "yes" : "no") . ")\n";
|
||||
print " -outdir <PATH> Specify output directory for sync (default: $out_basedir)\n";
|
||||
print " -builddir <PATH> Specify build directory for sync (default: $build_basedir)\n";
|
||||
print " -version <VERSION> Specify the module's version (default: detect from qglobal.h)\n";
|
||||
print " -quiet Only report problems, not activity (same as -verbose 0)\n";
|
||||
print " -v, -verbose <level> Sets the verbosity level (max. 4) (default: $verbose_level)\n";
|
||||
@ -652,6 +654,7 @@ sub listSubdirs {
|
||||
sub loadSyncProfile {
|
||||
if ($verbose_level) {
|
||||
print("<srcbase> = $basedir \n");
|
||||
print("<bldbase> = $build_basedir \n");
|
||||
print("<outbase> = $out_basedir \n");
|
||||
}
|
||||
|
||||
@ -672,6 +675,7 @@ sub loadSyncProfile {
|
||||
sub basePrettify {
|
||||
my ($arg) = @_;
|
||||
$$arg =~ s,^\Q$basedir\E,<srcbase>,;
|
||||
$$arg =~ s,^\Q$build_basedir\E,<bldbase>,;
|
||||
$$arg =~ s,^\Q$out_basedir\E,<outbase>,;
|
||||
}
|
||||
|
||||
@ -724,7 +728,7 @@ sub globosort($$) {
|
||||
}
|
||||
|
||||
# check if this is an in-source build, and if so use that as the basedir too
|
||||
$basedir = locateSyncProfile($out_basedir);
|
||||
$basedir = locateSyncProfile($build_basedir);
|
||||
if ($basedir) {
|
||||
$basedir = dirname($basedir) ;
|
||||
normalizePath(\$basedir);
|
||||
@ -749,6 +753,9 @@ while ( @ARGV ) {
|
||||
} elsif($arg eq "-o" || $arg eq "-outdir") {
|
||||
$var = "output";
|
||||
$val = shift @ARGV;
|
||||
} elsif($arg eq "-builddir") {
|
||||
$var = "build";
|
||||
$val = shift @ARGV;
|
||||
} elsif($arg eq "-showonly" || $arg eq "-remove-stale" || $arg eq "-windows" ||
|
||||
$arg eq "-relative" || $arg eq "-check-includes") {
|
||||
$var = substr($arg, 1);
|
||||
@ -875,6 +882,16 @@ while ( @ARGV ) {
|
||||
$out_basedir = $outdir;
|
||||
}
|
||||
normalizePath(\$out_basedir);
|
||||
} elsif ($var eq "build") {
|
||||
my $outdir = $val;
|
||||
if (checkRelative($outdir)) {
|
||||
$build_basedir = getcwd();
|
||||
chomp $build_basedir;
|
||||
$build_basedir .= "/" . $outdir;
|
||||
} else {
|
||||
$build_basedir = $outdir;
|
||||
}
|
||||
normalizePath(\$build_basedir);
|
||||
}
|
||||
}
|
||||
|
||||
@ -939,7 +956,7 @@ foreach my $lib (@modules_to_sync) {
|
||||
for my $p (keys %inject_headers) {
|
||||
next unless ($p =~ /^\Q$dir\E(\/|$)/);
|
||||
my $sp = $p;
|
||||
$sp =~ s,^\Q$basedir\E/,$out_basedir/,;
|
||||
$sp =~ s,^\Q$basedir\E/,$build_basedir/,;
|
||||
for my $n (@{$inject_headers{$p}}) {
|
||||
$injections{$sp."/".$n} = 1;
|
||||
}
|
||||
@ -1037,7 +1054,7 @@ foreach my $lib (@modules_to_sync) {
|
||||
my $requires;
|
||||
my $iheader_src = $subdir . "/" . $header;
|
||||
my $iheader = $iheader_src;
|
||||
$iheader =~ s/^\Q$basedir\E/$out_basedir/ if ($shadow);
|
||||
$iheader =~ s/^\Q$basedir\E/$build_basedir/ if ($shadow);
|
||||
if ($check_includes) {
|
||||
# We need both $public_header and $private_header because QPA headers count as neither
|
||||
my $private_header = !$public_header && !$qpa_header
|
||||
|
@ -22,7 +22,8 @@ load(qt_build_paths)
|
||||
for(mod, MODULE_INCNAME): \
|
||||
QMAKE_SYNCQT += -module $$mod
|
||||
QMAKE_SYNCQT += \
|
||||
-version $$VERSION -outdir $$system_quote($$MODULE_BASE_OUTDIR) $$MODULE_SYNCQT_DIR
|
||||
-version $$VERSION -outdir $$system_quote($$MODULE_BASE_OUTDIR) \
|
||||
-builddir $$system_quote($$shadowed($$MODULE_BASE_INDIR)) $$MODULE_SYNCQT_DIR
|
||||
!silent: message($$QMAKE_SYNCQT)
|
||||
system($$QMAKE_SYNCQT)|error("Failed to run: $$QMAKE_SYNCQT")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user