From adc3f08d4dd53e6f8a7564428560f0860d91b5f6 Mon Sep 17 00:00:00 2001 From: mappu Date: Thu, 6 Feb 2025 19:16:56 +1300 Subject: [PATCH] rcc: infer embed data rcc filename from go file instead of qrc file --- cmd/miqt-rcc/main.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/miqt-rcc/main.go b/cmd/miqt-rcc/main.go index 0535adbe..cfdcb91c 100644 --- a/cmd/miqt-rcc/main.go +++ b/cmd/miqt-rcc/main.go @@ -17,8 +17,8 @@ func main() { // Parse arguments input := flag.String("Input", "", "Path to .qrc input file") - outputRcc := flag.String("OutputRcc", "", "(Optional) Path to .rcc output file. If omitted, inferred from the input file path") outputGo := flag.String("OutputGo", "", "(Optional) Path to .go output file. If omitted, interred from the input file path") + outputRcc := flag.String("OutputRcc", "", "(Optional) Path to .rcc output file. If omitted, inferred from the output Go file path") packageName := flag.String("Package", "main", "Package to use in generated Go files") variableName := flag.String("VariableName", "_resourceRcc", "Temporary global variable name for loading embedded data") useQt6 := flag.Bool("Qt6", false, "Use Qt 6 instead of Qt 5") @@ -33,12 +33,13 @@ func main() { // Fill in default output names, if not specified - if *outputRcc == "" { - *outputRcc = strings.TrimSuffix(*input, `.qrc`) + `.rcc` - } if *outputGo == "" { *outputGo = strings.TrimSuffix(*input, `.qrc`) + `.go` } + if *outputRcc == "" { + // Base this on the outputGo filename, not the input filename + *outputRcc = strings.TrimSuffix(*outputGo, `.go`) + `.rcc` + } // Compile qrc to binary resource file