Merge branch 'master' into alpha-kung
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
if [[ -z $QMAKE_SPEC ]]; then
|
||||
QMAKE_SPEC='linux-g++'
|
||||
fi
|
||||
|
||||
if [[ -z $USE_TIDY ]]; then
|
||||
MAKE_COMMAND='make --jobs'
|
||||
CLANG_TIDY=
|
||||
else
|
||||
# Bear replaces the compile database, it does not update it.
|
||||
# If you run 'bear make' and there is nothing to compile, you
|
||||
# will get an empty database.
|
||||
# Clean up the artifacts and run everything together in that case.
|
||||
MAKE_COMMAND='bear make --jobs'
|
||||
QMAKE_SPEC='linux-clang'
|
||||
CLANG_TIDY='../build_scripts/linux/run-clang-tidy.sh'
|
||||
fi
|
||||
|
||||
echo $MAKE_COMMAND
|
||||
mkdir -p build
|
||||
cd build
|
||||
qmake --version
|
||||
qmake -spec $QMAKE_SPEC ..
|
||||
$MAKE_COMMAND
|
||||
$CLANG_TIDY
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
clang-format --version
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
set +e
|
||||
clang-tidy --version
|
||||
|
||||
ERROR=0
|
||||
for file in $(find ../src -name "*.cpp"); do
|
||||
echo $file
|
||||
clang-tidy $file
|
||||
|
||||
EXIT=$?
|
||||
if [[ $EXIT != 0 ]]; then
|
||||
ERROR=1
|
||||
fi
|
||||
done
|
||||
set -e
|
||||
exit $ERROR
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
clang-format --version;
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
QMAKE_CXXFLAGS += -Wextra
|
||||
|
||||
QMAKE_CXXFLAGS += -Wshadow
|
||||
|
||||
QMAKE_CXXFLAGS += -Wold-style-cast
|
||||
|
||||
QMAKE_CXXFLAGS += -Wnon-virtual-dtor
|
||||
|
||||
QMAKE_CXXFLAGS += -Wcast-align -Wunused -Woverloaded-virtual -Wformat=2
|
||||
|
||||
QMAKE_CXXFLAGS += -Wdouble-promotion
|
||||
@@ -0,0 +1,18 @@
|
||||
include(common-msvc.pri)
|
||||
|
||||
#win32-clang-msvc is unable to correctly build the first time
|
||||
#with warnings as errors on. There seems to be an issue with the moc_predefs.h
|
||||
#file not being built correctly when /WX is on. Until the issue is fixed,
|
||||
#win32-clang-msvc is built without /WX.
|
||||
|
||||
#clang-msvc does not enable the c++17 flag with qmake's c++1z flag.
|
||||
QMAKE_CXXFLAGS += /std:c++17
|
||||
|
||||
include(clang-gcc-common-switches.pri)
|
||||
|
||||
QMAKE_CXXFLAGS += -Wmost
|
||||
|
||||
QMAKE_CXXFLAGS += -Weffc++ -Wmissing-variable-declarations
|
||||
|
||||
#clang-msvc spams warnings on -Wconversion and -Wsign-conversion
|
||||
# from the moc .cpp files including Qt stuff.
|
||||
@@ -0,0 +1,14 @@
|
||||
include(clang-gcc-common-switches.pri)
|
||||
|
||||
QMAKE_CXXFLAGS += -Wmost
|
||||
|
||||
QMAKE_CXXFLAGS += -Wpedantic
|
||||
|
||||
QMAKE_CXXFLAGS += -Werror
|
||||
#All includes from the third-party directory will not warn.
|
||||
QMAKE_CXXFLAGS += --system-header-prefix=third-party
|
||||
|
||||
# Sign conversion warns on auto generated Qt MOC files.
|
||||
QMAKE_CXXFLAGS += -Weffc++ -Wconversion -Wno-sign-conversion
|
||||
|
||||
QMAKE_CXXFLAGS += -Wextra-semi -Wzero-as-null-pointer-constant -Wmissing-variable-declarations
|
||||
@@ -0,0 +1,51 @@
|
||||
#Removing -W3 from both FLAGS is necessary, otherwise compiler will give
|
||||
#D9025: overriding '/W4' with '/W3'
|
||||
QMAKE_CFLAGS_WARN_ON -= -W3
|
||||
QMAKE_CXXFLAGS_WARN_ON -= -W3
|
||||
#C4127 is a warning in qvarlengtharray.h that can not be turned off
|
||||
#on the current version of MSVC.
|
||||
QMAKE_CXXFLAGS += /W4 /wd4127
|
||||
# The codecvt header being used in AudioManagerWindows.cpp is deprecated by the standard,
|
||||
# but no suitable replacement has been standardized yet. It is possible to use the Windows
|
||||
# specific MultiByteToWideChar() and WideCharToMultiByte() from <Windows.h>
|
||||
DEFINES += _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
|
||||
|
||||
# Enables Whole Program Optimization
|
||||
QMAKE_CXXFLAGS += /Gw
|
||||
|
||||
# 'identfier': conversion from 'type1' to 'type1', possible loss of data
|
||||
QMAKE_CXXFLAGS += /w14242
|
||||
# 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
|
||||
QMAKE_CXXFLAGS += /w14254
|
||||
# 'function': member function does not override any base class virtual member function
|
||||
QMAKE_CXXFLAGS += /w14263
|
||||
# 'classname': class has virtual functions, but destructor is not virtual instances of this class may not be destructed correctly
|
||||
QMAKE_CXXFLAGS += /w14265
|
||||
# 'operator': unsigned/negative constant mismatch
|
||||
QMAKE_CXXFLAGS += /w14287
|
||||
# nonstandard extension used: 'variable': loop control variable declared in the for-loop is used outside the for-loop scope
|
||||
QMAKE_CXXFLAGS += /we4289
|
||||
# 'operator': expression is always 'boolean_value'
|
||||
QMAKE_CXXFLAGS += /w14296
|
||||
# 'variable': pointer truncation from 'type1' to 'type2'
|
||||
QMAKE_CXXFLAGS += /w14311
|
||||
# expression before comma evaluates to a function which is missing an argument list
|
||||
QMAKE_CXXFLAGS += /w14545
|
||||
# function call before comma missing argument list
|
||||
QMAKE_CXXFLAGS += /w14546
|
||||
# 'operator': operator before comma has no effect; expected operator with side-effect
|
||||
QMAKE_CXXFLAGS += /w14547
|
||||
# 'operator': operator before comma has no effect; did you intend 'operator'?
|
||||
QMAKE_CXXFLAGS += /w14549
|
||||
# expression has no effect; expected expression with side-effect
|
||||
QMAKE_CXXFLAGS += /w14555
|
||||
# Enable warning on thread un-safe static member initialization
|
||||
QMAKE_CXXFLAGS += /w14640
|
||||
# Conversion from 'type1' to 'type_2' is sign-extended. This may cause unexpected runtime behavior.
|
||||
QMAKE_CXXFLAGS += /w14826
|
||||
# wide string literal cast to 'LPSTR'
|
||||
QMAKE_CXXFLAGS += /w14905
|
||||
# string literal cast to 'LPWSTR'
|
||||
QMAKE_CXXFLAGS += /w14906
|
||||
# illegal copy-initialization; more than one user-defined conversion has been implicitly applied
|
||||
QMAKE_CXXFLAGS += /w14928
|
||||
@@ -0,0 +1,16 @@
|
||||
#g++-7 is needed for C++17 features. travis does not supply this by default.
|
||||
QMAKE_CXX = g++-7
|
||||
|
||||
include(clang-gcc-common-switches.pri)
|
||||
|
||||
QMAKE_CXXFLAGS += -Wpedantic
|
||||
|
||||
QMAKE_CXXFLAGS += -Werror
|
||||
|
||||
# GCC only switches
|
||||
QMAKE_CXXFLAGS += -Wduplicated-branches -Wduplicated-cond -Wlogical-op -Wrestrict -Wnull-dereference
|
||||
|
||||
# Sign conversion warns on auto generated Qt MOC files.
|
||||
QMAKE_CXXFLAGS += -Wconversion -Wno-sign-conversion
|
||||
|
||||
QMAKE_CXXFLAGS += -Wzero-as-null-pointer-constant
|
||||
@@ -0,0 +1,10 @@
|
||||
include(common-msvc.pri)
|
||||
|
||||
# Warnings as errors
|
||||
QMAKE_CXXFLAGS += /WX
|
||||
|
||||
# Enables Link Time Optimization
|
||||
QMAKE_CXXFLAGS += /GL
|
||||
|
||||
# Force standards-conformance
|
||||
QMAKE_CXXFLAGS += /permissive-
|
||||
@@ -0,0 +1,36 @@
|
||||
project_dir = $$PWD/../../
|
||||
|
||||
win32:LIBS += -L"$$project_dir/third-party/openvr/lib/win64" -luser32 -lole32
|
||||
unix:LIBS += -L"$$project_dir/third-party/openvr/lib/linux64"
|
||||
LIBS += -lopenvr_api
|
||||
|
||||
RESOURCES += src/res/resources.qrc
|
||||
|
||||
DISTFILES += \
|
||||
src/res/sounds/alarm01.wav \
|
||||
src/res/img/audio/microphone/ptt_notification.png \
|
||||
src/res/img/audio/microphone/ptt_notification.svg \
|
||||
src/res/img/battery/* \
|
||||
src/res/img/icons/* \
|
||||
src/res/qml/qmldir \
|
||||
src/res/qml/audio_page/* \
|
||||
src/res/qml/ChaperonePage.qml \
|
||||
src/res/qml/ChaperoneWarningsPage.qml \
|
||||
src/res/qml/FixFloorPage.qml \
|
||||
src/res/qml/PlayspacePage.qml \
|
||||
src/res/qml/RevivePage.qml \
|
||||
src/res/qml/RootPage.qml \
|
||||
src/res/qml/SettingsPage.qml \
|
||||
src/res/qml/StatisticsPage.qml \
|
||||
src/res/qml/SteamVRPage.qml \
|
||||
src/res/qml/utilities_page/* \
|
||||
src/res/qml/utilities_page/media_keys/* \
|
||||
src/res/qml/utilities_page/keyboard_utils/* \
|
||||
src/res/qml/utilities_page/desktop_size/* \
|
||||
src/res/qml/utilities_page/alarm_clock/* \
|
||||
src/res/qml/audio_page/dialog_boxes/* \
|
||||
src/res/qml/audio_page/device_selector/* \
|
||||
src/res/qml/audio_page/proximity/* \
|
||||
src/res/qml/audio_page/push_to_talk/* \
|
||||
src/res/qml/audio_page/profiles/* \
|
||||
src/res/qml/common/* \
|
||||
@@ -0,0 +1,69 @@
|
||||
SOURCES += src/main.cpp\
|
||||
src/overlaycontroller.cpp \
|
||||
src/tabcontrollers/AudioTabController.cpp \
|
||||
src/tabcontrollers/ChaperoneTabController.cpp \
|
||||
src/tabcontrollers/FixFloorTabController.cpp \
|
||||
src/tabcontrollers/MoveCenterTabController.cpp \
|
||||
src/tabcontrollers/SettingsTabController.cpp \
|
||||
src/tabcontrollers/StatisticsTabController.cpp \
|
||||
src/tabcontrollers/SteamVRTabController.cpp \
|
||||
src/tabcontrollers/ReviveTabController.cpp \
|
||||
src/tabcontrollers/UtilitiesTabController.cpp \
|
||||
src/tabcontrollers/PttController.cpp \
|
||||
src/utils/ChaperoneUtils.cpp \
|
||||
src/tabcontrollers/audiomanager/AudioManagerDummy.cpp \
|
||||
src/tabcontrollers/keyboardinput/KeyboardInputDummy.cpp \
|
||||
src/overlaycontroller/openvr_init.cpp \
|
||||
src/ivrinput/ivrinput.cpp
|
||||
|
||||
HEADERS += src/overlaycontroller.h \
|
||||
src/tabcontrollers/AudioTabController.h \
|
||||
src/tabcontrollers/ChaperoneTabController.h \
|
||||
src/tabcontrollers/FixFloorTabController.h \
|
||||
src/tabcontrollers/MoveCenterTabController.h \
|
||||
src/tabcontrollers/SettingsTabController.h \
|
||||
src/tabcontrollers/StatisticsTabController.h \
|
||||
src/tabcontrollers/SteamVRTabController.h \
|
||||
src/tabcontrollers/ReviveTabController.h \
|
||||
src/tabcontrollers/UtilitiesTabController.h \
|
||||
src/tabcontrollers/AudioManager.h \
|
||||
src/tabcontrollers/PttController.h \
|
||||
src/tabcontrollers/KeyboardInput.h \
|
||||
src/utils/Matrix.h \
|
||||
src/utils/ChaperoneUtils.h \
|
||||
src/tabcontrollers/audiomanager/AudioManagerDummy.h \
|
||||
src/tabcontrollers/keyboardinput/KeyboardInputDummy.h \
|
||||
src/overlaycontroller/openvr_init.h \
|
||||
src/ivrinput/ivrinput_action.h \
|
||||
src/ivrinput/ivrinput_manifest.h \
|
||||
src/ivrinput/ivrinput_action_set.h \
|
||||
src/ivrinput/ivrinput.h
|
||||
|
||||
win32 {
|
||||
SOURCES += src/tabcontrollers/audiomanager/AudioManagerWindows.cpp \
|
||||
src/tabcontrollers/keyboardinput/KeyboardInputWindows.cpp
|
||||
HEADERS += src/tabcontrollers/audiomanager/AudioManagerWindows.h \
|
||||
src/tabcontrollers/keyboardinput/KeyboardInputWindows.h
|
||||
}
|
||||
|
||||
win32-msvc {
|
||||
INCLUDEPATH += third-party/openvr/headers \
|
||||
third-party/easylogging++ \
|
||||
third-party/policyconfig
|
||||
}
|
||||
|
||||
win32-clang-msvc {
|
||||
QMAKE_CXXFLAGS += /imsvc "$$PWD/../../third-party/openvr/headers"
|
||||
QMAKE_CXXFLAGS += /imsvc "$$PWD/../../third-party/easylogging++"
|
||||
QMAKE_CXXFLAGS += /imsvc "$$PWD/../../third-party/policyconfig"
|
||||
}
|
||||
|
||||
# Anything g++ or clang
|
||||
# In order to suppress warnings in third party headers
|
||||
*clang|*clang-g++|*clang-libc++|*g++* {
|
||||
QMAKE_CXXFLAGS += -isystem ../third-party/openvr/headers
|
||||
QMAKE_CXXFLAGS += -isystem ../third-party/easylogging++
|
||||
}
|
||||
|
||||
# easylogging++ used to be a header only lib. Now requires easylogging++.cc
|
||||
SOURCES += third-party/easylogging++/easylogging++.cc
|
||||
Reference in New Issue
Block a user