Skip to content

Commit

Permalink
1、加入OpenArduPilotLog的Action
Browse files Browse the repository at this point in the history
2、配置*.pri文件,完成编译后自动发布
3、给生成的*.exe加上图标
  • Loading branch information
SuWeipeng committed Dec 23, 2017
1 parent 2eebfbf commit 9767763
Show file tree
Hide file tree
Showing 32 changed files with 618 additions and 31 deletions.
226 changes: 226 additions & 0 deletions APLCommon.pri
@@ -0,0 +1,226 @@
linux {
linux-g++ | linux-g++-64 | linux-g++-32 | linux-clang {
message("Linux build")
CONFIG += LinuxBuild
DEFINES += __STDC_LIMIT_MACROS
linux-clang {
message("Linux clang")
QMAKE_CXXFLAGS += -Qunused-arguments -fcolor-diagnostics
}
} else : linux-rasp-pi2-g++ {
message("Linux R-Pi2 build")
CONFIG += LinuxBuild
DEFINES += __STDC_LIMIT_MACROS __rasp_pi2__
} else : android-g++ {
CONFIG += AndroidBuild MobileBuild
DEFINES += __android__
DEFINES += __STDC_LIMIT_MACROS
DEFINES += APL_ENABLE_BLUETOOTH
target.path = $$DESTDIR
equals(ANDROID_TARGET_ARCH, x86) {
CONFIG += Androidx86Build
DEFINES += __androidx86__
message("Android x86 build")
} else {
message("Android Arm build")
}
} else {
error("Unsuported Linux toolchain, only GCC 32- or 64-bit is supported")
}
} else : win32 {
win32-msvc2010 | win32-msvc2012 | win32-msvc2013 | win32-msvc2015 {
message("Windows build")
CONFIG += WindowsBuild
DEFINES += __STDC_LIMIT_MACROS
} else {
error("Unsupported Windows toolchain, only Visual Studio 2010, 2012, and 2013 are supported")
}
} else : macx {
macx-clang | macx-llvm {
message("Mac build")
CONFIG += MacBuild
DEFINES += __macos__
CONFIG += x86_64
CONFIG -= x86
equals(QT_MAJOR_VERSION, 5) | greaterThan(QT_MINOR_VERSION, 5) {
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7
} else {
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6
}
#-- Not forcing anything. Let qmake find the latest, installed SDK.
#QMAKE_MAC_SDK = macosx10.12
QMAKE_CXXFLAGS += -fvisibility=hidden
} else {
error("Unsupported Mac toolchain, only 64-bit LLVM+clang is supported")
}
} else : ios {
!equals(QT_MAJOR_VERSION, 5) | !greaterThan(QT_MINOR_VERSION, 4) {
error("Unsupported Qt version, 5.5.x or greater is required for iOS")
}
message("iOS build")
CONFIG += iOSBuild MobileBuild app_bundle NoSerialBuild
CONFIG -= bitcode
DEFINES += __ios__
DEFINES += APL_NO_GOOGLE_MAPS
DEFINES += NO_SERIAL_LINK
DEFINES += APL_DISABLE_UVC
QMAKE_IOS_DEPLOYMENT_TARGET = 8.0
QMAKE_IOS_TARGETED_DEVICE_FAMILY = 1,2 # Universal
QMAKE_LFLAGS += -Wl,-no_pie
} else {
error("Unsupported build platform, only Linux, Windows, Android and Mac (Mac OS and iOS) are supported")
}

# Enable ccache where we can
linux|macx|ios {
system(which ccache) {
message("Found ccache, enabling")
!ios {
QMAKE_CXX = ccache $$QMAKE_CXX
QMAKE_CC = ccache $$QMAKE_CC
} else {
QMAKE_CXX = $$PWD/tools/iosccachecc.sh
QMAKE_CC = $$PWD/tools/iosccachecxx.sh
}
}
}

MobileBuild {
DEFINES += __mobile__
}

# set the APL version from git

exists ($$PWD/.git) {
GIT_DESCRIBE = $$system(git --git-dir $$PWD/.git --work-tree $$PWD describe --always --tags)
GIT_BRANCH = $$system(git --git-dir $$PWD/.git --work-tree $$PWD rev-parse --abbrev-ref HEAD)
GIT_HASH = $$system(git --git-dir $$PWD/.git --work-tree $$PWD rev-parse --short HEAD)
GIT_TIME = $$system(git --git-dir $$PWD/.git --work-tree $$PWD show --oneline --format=\"%ci\" -s HEAD)

# determine if we're on a tag matching vX.Y.Z (stable release)
contains(GIT_DESCRIBE, v[0-9]+.[0-9]+.[0-9]+) {
# release version "vX.Y.Z"
GIT_VERSION = $${GIT_DESCRIBE}
} else {
# development version "Development branch:sha date"
GIT_VERSION = "Development $${GIT_BRANCH}:$${GIT_HASH} $${GIT_TIME}"
}

VERSION = $$replace(GIT_DESCRIBE, "v", "")
VERSION = $$replace(VERSION, "-", ".")
VERSION = $$section(VERSION, ".", 0, 3)
MacBuild {
MAC_VERSION = $$section(VERSION, ".", 0, 2)
MAC_BUILD = $$section(VERSION, ".", 3, 3)
message(ArduPilotLog version $${MAC_VERSION} build $${MAC_BUILD} describe $${GIT_VERSION})
} else {
message(ArduPilotLog $${GIT_VERSION})
}
} else {
GIT_VERSION = None
VERSION = 0.0.0 # Marker to indicate out-of-tree build
MAC_VERSION = 0.0.0
MAC_BUILD = 0
}

DEFINES += GIT_VERSION=\"\\\"$$GIT_VERSION\\\"\"
DEFINES += EIGEN_MPL2_ONLY

# Installer configuration

installer {
CONFIG -= debug
CONFIG -= debug_and_release
CONFIG += release
message(Build Installer)
}

# Setup our supported build flavors

CONFIG(debug, debug|release) {
message(Debug flavor)
CONFIG += DebugBuild
} else:CONFIG(release, debug|release) {
message(Release flavor)
CONFIG += ReleaseBuild
} else {
error(Unsupported build flavor)
}

# Setup our build directories

BASEDIR = $$IN_PWD

!iOSBuild {
OBJECTS_DIR = $${OUT_PWD}/obj
MOC_DIR = $${OUT_PWD}/moc
UI_DIR = $${OUT_PWD}/ui
RCC_DIR = $${OUT_PWD}/rcc
}

LANGUAGE = C++

LOCATION_PLUGIN_DESTDIR = $${OUT_PWD}/src/QtLocationPlugin
LOCATION_PLUGIN_NAME = QGeoServiceProviderFactoryAPL

# Turn off serial port warnings
DEFINES += _TTY_NOWARN_

MacBuild | LinuxBuild {
QMAKE_CXXFLAGS_WARN_ON += -Wall
WarningsAsErrorsOn {
QMAKE_CXXFLAGS_WARN_ON += -Werror
}
MacBuild {
# Latest clang version has a buggy check for this which cause Qt headers to throw warnings on qmap.h
QMAKE_CXXFLAGS_WARN_ON += -Wno-return-stack-address
# Xcode 8.3 has issues on how MAVLink accesses (packed) message structure members.
# Note that this will fail when Xcode version reaches 10.x.x
XCODE_VERSION = $$system($$PWD/tools/get_xcode_version.sh)
greaterThan(XCODE_VERSION, 8.2.0): QMAKE_CXXFLAGS_WARN_ON += -Wno-address-of-packed-member
}
}

WindowsBuild {
win32-msvc2015 {
QMAKE_CFLAGS -= -Zc:strictStrings
QMAKE_CXXFLAGS -= -Zc:strictStrings
}
QMAKE_CFLAGS_RELEASE -= -Zc:strictStrings
QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO -= -Zc:strictStrings

QMAKE_CXXFLAGS_RELEASE -= -Zc:strictStrings
QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO -= -Zc:strictStrings
QMAKE_CXXFLAGS_WARN_ON += /W3 \
/wd4996 \ # silence warnings about deprecated strcpy and whatnot
/wd4005 \ # silence warnings about macro redefinition
/wd4290 # ignore exception specifications

WarningsAsErrorsOn {
QMAKE_CXXFLAGS_WARN_ON += /WX
}
}

#
# Build-specific settings
#

ReleaseBuild {
DEFINES += QT_NO_DEBUG QT_MESSAGELOGCONTEXT
CONFIG += force_debug_info # Enable debugging symbols on release builds
!iOSBuild {
CONFIG += ltcg # Turn on link time code generation
}

WindowsBuild {
# Enable function level linking and enhanced optimized debugging
QMAKE_CFLAGS_RELEASE += /Gy /Zo
QMAKE_CXXFLAGS_RELEASE += /Gy /Zo
QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += /Gy /Zo
QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += /Gy /Zo

# Eliminate duplicate COMDATs
QMAKE_LFLAGS_RELEASE += /OPT:ICF
QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO += /OPT:ICF
}
}
10 changes: 0 additions & 10 deletions APLDockWidget.cpp
@@ -1,13 +1,3 @@
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/


#include "APLDockWidget.h"

#include <QCloseEvent>
Expand Down
10 changes: 0 additions & 10 deletions APLDockWidget.h
@@ -1,13 +1,3 @@
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/


#ifndef APLDockWidget_h
#define APLDockWidget_h

Expand Down
3 changes: 0 additions & 3 deletions APLLoggingCategory.cpp
Expand Up @@ -2,9 +2,6 @@

#include <QSettings>

// Add Global logging categories (not class specific) here using APL_LOGGING_CATEGORY
APL_LOGGING_CATEGORY(FirmwareUpgradeLog, "FirmwareUpgradeLog")

APLLoggingCategoryRegister* _instance = NULL;
const char* APLLoggingCategoryRegister::_filterRulesSettingsGroup = "LoggingFilters";

Expand Down
4 changes: 1 addition & 3 deletions APLLoggingCategory.h
Expand Up @@ -4,8 +4,6 @@
#include <QLoggingCategory>
#include <QStringList>

Q_DECLARE_LOGGING_CATEGORY(MainWindow)

/// @def APL_LOGGING_CATEGORY
/// This is a APL specific replacement for Q_LOGGING_CATEGORY. It will register the category name into a
/// global list. It's usage is the same as Q_LOGGING_CATEOGRY.
Expand Down Expand Up @@ -48,7 +46,7 @@ class APLLoggingCategoryRegister : public QObject
class APLLoggingCategory
{
public:
APLLoggingCategory(const char* category) { QGCLoggingCategoryRegister::instance()->registerCategory(category); }
APLLoggingCategory(const char* category) { APLLoggingCategoryRegister::instance()->registerCategory(category); }
};

#endif // APLLOGGINGCATEGORY_H

0 comments on commit 9767763

Please sign in to comment.