summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2018-02-12 17:56:32 +0100
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2018-02-15 17:02:34 +0000
commitede6c447560b9419ee9d2991059e488a7d5a3208 (patch)
treef280b15ab9d93136c97b05b2484b872ad6cd7ae4 /bin
parenta060bf9673477499d85b04d8d5b21fb2a2f15c4f (diff)
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>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/syncqt.pl23
1 files changed, 20 insertions, 3 deletions
diff --git a/bin/syncqt.pl b/bin/syncqt.pl
index 52bd97e88d..02194aa0b7 100755
--- a/bin/syncqt.pl
+++ b/bin/syncqt.pl
@@ -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