From 8b8831f9ada63c5b81beec40619b67e5529dbfe4 Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 28 Apr 2024 22:42:30 +0800 Subject: improve ldflags for autoconf --- tests/projects/qt/quickapp/src/main.cpp | 3 +-- tests/projects/qt/widgetapp/src/main.cpp | 4 +--- tests/projects/qt/widgetapp_static/src/main.cpp | 4 +--- xmake/modules/package/tools/autoconf.lua | 7 ++----- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/tests/projects/qt/quickapp/src/main.cpp b/tests/projects/qt/quickapp/src/main.cpp index 2ec4b880c..7d9cb80df 100644 --- a/tests/projects/qt/quickapp/src/main.cpp +++ b/tests/projects/qt/quickapp/src/main.cpp @@ -1,8 +1,7 @@ #include #include -int main(int argc, char *argv[]) -{ +int main(int argc, char *argv[]) { #if QT_VERSION >= 0x50601 QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); #endif diff --git a/tests/projects/qt/widgetapp/src/main.cpp b/tests/projects/qt/widgetapp/src/main.cpp index b48f94ec8..eb4e26c90 100644 --- a/tests/projects/qt/widgetapp/src/main.cpp +++ b/tests/projects/qt/widgetapp/src/main.cpp @@ -1,11 +1,9 @@ #include "mainwindow.h" #include -int main(int argc, char *argv[]) -{ +int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.show(); - return a.exec(); } diff --git a/tests/projects/qt/widgetapp_static/src/main.cpp b/tests/projects/qt/widgetapp_static/src/main.cpp index b48f94ec8..eb4e26c90 100644 --- a/tests/projects/qt/widgetapp_static/src/main.cpp +++ b/tests/projects/qt/widgetapp_static/src/main.cpp @@ -1,11 +1,9 @@ #include "mainwindow.h" #include -int main(int argc, char *argv[]) -{ +int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.show(); - return a.exec(); } diff --git a/xmake/modules/package/tools/autoconf.lua b/xmake/modules/package/tools/autoconf.lua index 11087b77a..7636cad60 100644 --- a/xmake/modules/package/tools/autoconf.lua +++ b/xmake/modules/package/tools/autoconf.lua @@ -339,12 +339,9 @@ function buildenvs(package, opt) if arflags then envs.ARFLAGS = table.concat(_translate_paths(arflags), ' ') end - if ldflags then - envs.LDFLAGS = table.concat(_translate_paths(ldflags), ' ') - end - if shflags then + if ldflags or shflags then -- autoconf does not use SHFLAGS - envs.LDFLAGS = table.concat(_translate_paths(shflags), ' ') + envs.LDFLAGS = table.concat(_translate_paths(table.join(ldflags or {}, shflags)), ' ') end -- cross-compilation? pass the full build environments -- cgit v1.3.1