From cd6403b8ffb1729397f2213a3783f0452eb4a048 Mon Sep 17 00:00:00 2001 From: Vasily Date: Wed, 23 Jan 2019 19:31:03 +0100 Subject: [PATCH 1/9] Update .pro file and add test C++17 statements to main The test statements are making sure C++17 features are enabled on all compilers. They should not be pushed to master as they are. --- advancedSettings.pro | 2 +- src/main.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/advancedSettings.pro b/advancedSettings.pro index a16d072..e66e72e 100644 --- a/advancedSettings.pro +++ b/advancedSettings.pro @@ -5,7 +5,7 @@ #------------------------------------------------- QT += core gui qml quick multimedia widgets -CONFIG += c++14 +CONFIG += c++1z DEFINES += ELPP_THREAD_SAFE ELPP_QT_LOGGING ELPP_NO_DEFAULT_LOG_FILE diff --git a/src/main.cpp b/src/main.cpp index cbc85c6..70ecddd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -348,6 +348,15 @@ int main( int argc, char* argv[] ) { setUpLogging( argc, argv ); + // Initializers in if statements is a C++17 feature. Should be removed after + // making sure CI works with this. + if ( constexpr int i = 2; i > 10 ) + { + // static_assert with no message is a C++17 feature. Should be removed + // after making sure CI works with this. + static_assert( i < 5 ); + } + const bool desktopMode = argument::CheckCommandLineArgument( argc, argv, argument::kDesktopMode ); const bool noSound From 583a62fb9c6e0ba6e63550761a0dd0f110f8e61e Mon Sep 17 00:00:00 2001 From: Vasily Date: Wed, 23 Jan 2019 19:39:29 +0100 Subject: [PATCH 2/9] Update readme badges to reflect C++17 and Python dependency The badge had not been updated for C++14 when we made the change. It had also not been updated to reflect the dependency on Python during the creation of the build script. --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 97b63e8..19aa499 100644 --- a/Readme.md +++ b/Readme.md @@ -1,4 +1,4 @@ -![language](https://img.shields.io/badge/Language-C%2B%2B11%2C%20QML-green.svg) ![dependencies](https://img.shields.io/badge/Dependencies-OpenVR%2C%20Qt5-green.svg) +![language](https://img.shields.io/badge/Language-C%2B%2B17%2C%20QML-green.svg) ![dependencies](https://img.shields.io/badge/Dependencies-OpenVR%2C%20Qt5%2C%20Python3-green.svg) ![license_gpl3](https://img.shields.io/badge/License-GPL%203.0-green.svg) [![Build status](https://ci.appveyor.com/api/projects/status/8oivf5xws6vsq2x3/branch/master?svg=true)](https://ci.appveyor.com/project/icewind1991/openvr-advancedsettings/branch/master) [![Build Status](https://travis-ci.org/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings.svg?branch=master)](https://travis-ci.org/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings) From 80a28bf7449bdaa206d8e47e85fa123af1cafc17 Mon Sep 17 00:00:00 2001 From: Vasily Date: Wed, 23 Jan 2019 19:57:22 +0100 Subject: [PATCH 3/9] Update readme information The Known Bugs section was removed because that's literally why the issue tracker exists. --- Readme.md | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/Readme.md b/Readme.md index 19aa499..2c14445 100644 --- a/Readme.md +++ b/Readme.md @@ -28,7 +28,6 @@ > * [Building on Windows](#building_on_windows) > * [Building on Linux](#building_on_linux) > * [Notes](#notes) - > * [Known Bugs](#known_bugs) > * [License](#license) @@ -42,7 +41,7 @@ Adds an overlay to the OpenVR dashboard that allows access to advanced settings. # Features - Set supersampling values. -- Enable/disable asynchronous and interleaved reprojection. +- Enable/disable motion smoothing and advanced supersample filtering. - Save supersampling and reprojection settings into profiles. - Change several chaperone settings not accessible via SteamVR settings (to e.g. make it completely invisible). - Chaperone Proximity Warning: Several warning methods can be configured. @@ -54,7 +53,7 @@ Adds an overlay to the OpenVR dashboard that allows access to advanced settings. - Mute/unmute and set volume of audio mirror device. - Mute/unmute and set volume of microphone device. - Implements push-to-talk and allows to configure push-to-talk profiles. -- Desktop mode shows a window on the desktop instead of a vr overlay. +- Desktop mode shows a window on the desktop instead of a VR overlay. - Revive settings support (Requires [Revive 1.0.4+](https://github.com/LibreVR/Revive) for full functionality). - VR Keyboard Input Utilities - Simple Alarm Clock @@ -68,13 +67,12 @@ Adds an overlay to the OpenVR dashboard that allows access to advanced settings. Download the newest installer from the [release section](https://github.com/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings/releases) and execute it. -If you have an older standalone version installed, delete the old application folder first. +If you have an older standalone version installed, the installer will automatically uninstall the old version and install the new version. ## Standalone -I am not currently providing standalone Archives if you want a standalone version you can: -Download the newest standalone archive from the [release section](https://github.com/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings/releases)and unpack the archive. +Download the newest standalone archive from the [release section](https://github.com/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings/releases) and unpack the archive. To install for the first time simply start AdvancedSettings.exe once while SteamVR is running. It will register with SteamVR and automatically starts whenever SteamVR starts (Can be disabled in the settings). @@ -108,7 +106,7 @@ The following actions currently exist: The application (`AdvancedSettings.exe`) can be run with the following optional arguments: -`"-desktop"`: Creates a settings window on the desktop as well as in VR. Running `startdesktopmode.bat` in the install directory has the same effect. +`"-desktop"`: Creates a settings window on the desktop, but not in VR. Running `startdesktopmode.bat` in the install directory has the same effect. `"-nosound"`: Forces sound effects off. @@ -118,7 +116,7 @@ The application (`AdvancedSettings.exe`) can be run with the following optional `"-removemanifest"`: Force uninstalls the `.vrmanifest`. This should be done every time the application is uninstalled. On Windows it is automatically done by the uninstaller. The program will exit early when this flag is set. -`"-bindingsinterface"`: Makes Advanced Settings show up in the SteamVR bindings interface. This is necessary for binding keys to actions. This is the same as running `bindingsinterface.bat` from the executable directory. +`"-bindingsinterface"`: Makes Advanced Settings show up in the SteamVR bindings interface. This is necessary for binding keys to actions. This is the same as running `bindingsinterface.bat` from the executable directory. The program will not exit when this is set. No normal functionality is available except using the bindings interface. Bindings set with this active will be available when this isn't active. In addition, the application can receive the command line arguments from the [Easylogging++ library](https://github.com/zuhd-org/easyloggingpp#application-arguments). @@ -130,7 +128,9 @@ The logging output of the [Easylogging++ library](https://github.com/zuhd-org/ea ## Preview builds -If you want to try latest and greatest unreleased features, you can download latest changes in the alpha branches of the repository. +If you want to try latest and greatest unreleased features, you can download latest from the CI (Continuous Integration) server for [Windows](https://ci.appveyor.com/project/icewind1991/openvr-advancedsettings). The Linux CI does not provide binary artifacts. + +These version are not stable and this should be considered for advanced users only. # Documentation @@ -227,6 +227,8 @@ Allows to temporarily move and rotate the center of the playspace. This allows t ![Revive Page](docs/screenshots/RevivePage.png) +**The Revive page is not currently being maintained. Features may not be stable, performant or actually work.** + The Revive page is only visible when the [Revive overlay](https://github.com/LibreVR/Revive) is installed. In case an installed Revive overlay is not correctly detected you can force the Revive page in the settings. Any changes to controller settings are immediately applied by Revive (Requires Revive 1.0.4+). @@ -312,11 +314,6 @@ If you want to contribute changes running `clang-format` is necessary. More deta - You can modify the shutdown wait time when restarting SteamVR by opening restartvrserver.bat and changing the number behind "timeout /t" (unit is seconds). - -# Known Bugs - -- None yet. - # License From d04cf3286396958558a72aaeb3804def060d35f2 Mon Sep 17 00:00:00 2001 From: Vasily Date: Wed, 23 Jan 2019 20:03:36 +0100 Subject: [PATCH 4/9] Update CI badges, update preview version link Having the CI on their own line prevents the initial line from getting way too long. The preview version link should not show in development alpha branches, but only the relatively tested master. --- Readme.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 2c14445..5588017 100644 --- a/Readme.md +++ b/Readme.md @@ -1,5 +1,6 @@ ![language](https://img.shields.io/badge/Language-C%2B%2B17%2C%20QML-green.svg) ![dependencies](https://img.shields.io/badge/Dependencies-OpenVR%2C%20Qt5%2C%20Python3-green.svg) ![license_gpl3](https://img.shields.io/badge/License-GPL%203.0-green.svg) + [![Build status](https://ci.appveyor.com/api/projects/status/8oivf5xws6vsq2x3/branch/master?svg=true)](https://ci.appveyor.com/project/icewind1991/openvr-advancedsettings/branch/master) [![Build Status](https://travis-ci.org/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings.svg?branch=master)](https://travis-ci.org/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings) @@ -128,7 +129,7 @@ The logging output of the [Easylogging++ library](https://github.com/zuhd-org/ea ## Preview builds -If you want to try latest and greatest unreleased features, you can download latest from the CI (Continuous Integration) server for [Windows](https://ci.appveyor.com/project/icewind1991/openvr-advancedsettings). The Linux CI does not provide binary artifacts. +If you want to try latest and greatest unreleased features, you can download latest from the CI (Continuous Integration) server for [Windows](https://ci.appveyor.com/project/icewind1991/openvr-advancedsettings/branch/master). The Linux CI does not provide binary artifacts. These version are not stable and this should be considered for advanced users only. From 43bf20da45940f3e64513f5ff0b434400752be3f Mon Sep 17 00:00:00 2001 From: Vasily Date: Wed, 23 Jan 2019 20:43:44 +0100 Subject: [PATCH 5/9] Fix msvc and clang-msvc warnings with C++17 The codecvt header has been deprecatd for C++17, but no replacement has been specified in the standard. It is possible to use the Windows specific MultiByteToWideChar() and WideCharToMultiByte() from instead, however the codecvt header still works so there's no reason to change it until a proper replacement has been specified in the standard. It is additionally necessary to manually set the standard for clang-msvc to C++17. --- advancedSettings.pro | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/advancedSettings.pro b/advancedSettings.pro index e66e72e..3b9f7ff 100644 --- a/advancedSettings.pro +++ b/advancedSettings.pro @@ -22,6 +22,10 @@ TEMPLATE = app QMAKE_CXXFLAGS_WARN_ON -= -W3 #C4127 was in a third party file with no way to turn off. 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 + DEFINES += _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING !*clang-msvc { #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 @@ -31,6 +35,10 @@ TEMPLATE = app } } +win32-clang-msvc{ + QMAKE_CXXFLAGS += /std:c++17 +} + *g++* { QMAKE_CXXFLAGS += -Werror } From 20341021c50af19a0f0dd7841ca6cbd2df21d0a6 Mon Sep 17 00:00:00 2001 From: Vasily Date: Wed, 23 Jan 2019 21:11:36 +0100 Subject: [PATCH 6/9] Update travis to use clang and g++7 --- .travis.yml | 25 ++++++++++++++++++++----- advancedSettings.pro | 4 ++++ 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1223fc0..dbd7fa9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,24 @@ language: cpp dist: xenial -compiler: - - clang - - gcc + +matrix: + include: + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-7 + env: + - QMAKE_SPEC=linux-g++ + + - os: linux + env: + - QMAKE_SPEC=linux-clang + +before_install: + - python ./build_scripts/run-clang-format.py ./src -r --color always install: - sudo add-apt-repository ppa:kubuntu-ppa/backports -y @@ -10,7 +26,6 @@ install: - sudo apt-get install build-essential qtbase5-dev qttools5-dev qtdeclarative5-dev qtmultimedia5-dev qt5-default qttools5-dev-tools script: - - python ./build_scripts/run-clang-format.py ./src -r --color always - mkdir build && cd build - - qmake .. + - qmake .. -spec $QMAKE_SPEC - make diff --git a/advancedSettings.pro b/advancedSettings.pro index 3b9f7ff..18aecae 100644 --- a/advancedSettings.pro +++ b/advancedSettings.pro @@ -40,7 +40,10 @@ win32-clang-msvc{ } *g++* { + #g++-7 is needed for C++17 features. travis does not supply this by default. + QMAKE_CXX = g++-7 QMAKE_CXXFLAGS += -Werror + QMAKE_CXXFLAGS += -std=c++17 } #Look for anything clang that is not clang-msvc, since it does not @@ -49,6 +52,7 @@ win32-clang-msvc{ QMAKE_CXXFLAGS += -Werror #All includes from the third-party directory will not warn. QMAKE_CXXFLAGS += --system-header-prefix=third-party + QMAKE_CXXFLAGS += -std=c++17 } SOURCES += src/main.cpp\ src/overlaycontroller.cpp \ From c0c824d38061e501d136e872002a9598aa93ba8a Mon Sep 17 00:00:00 2001 From: Vasily Date: Wed, 23 Jan 2019 21:56:44 +0100 Subject: [PATCH 7/9] Remove C++17 flags from g++ and clang The flags are already being applied by QMAKE. --- .travis.yml | 2 +- advancedSettings.pro | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index dbd7fa9..ba22bb5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ matrix: - g++-7 env: - QMAKE_SPEC=linux-g++ - + - os: linux env: - QMAKE_SPEC=linux-clang diff --git a/advancedSettings.pro b/advancedSettings.pro index 18aecae..05c41b6 100644 --- a/advancedSettings.pro +++ b/advancedSettings.pro @@ -36,6 +36,7 @@ TEMPLATE = app } win32-clang-msvc{ + #clang-msvc does not enable the c++17 flag with qmake's c++1z flag. QMAKE_CXXFLAGS += /std:c++17 } @@ -43,7 +44,6 @@ win32-clang-msvc{ #g++-7 is needed for C++17 features. travis does not supply this by default. QMAKE_CXX = g++-7 QMAKE_CXXFLAGS += -Werror - QMAKE_CXXFLAGS += -std=c++17 } #Look for anything clang that is not clang-msvc, since it does not @@ -52,7 +52,6 @@ win32-clang-msvc{ QMAKE_CXXFLAGS += -Werror #All includes from the third-party directory will not warn. QMAKE_CXXFLAGS += --system-header-prefix=third-party - QMAKE_CXXFLAGS += -std=c++17 } SOURCES += src/main.cpp\ src/overlaycontroller.cpp \ From 168d9d38fdfbc5332ecdbc292984c900f6c17120 Mon Sep 17 00:00:00 2001 From: Vasily Date: Wed, 23 Jan 2019 22:33:00 +0100 Subject: [PATCH 8/9] Remove C++17 testing code Featured C++17 features to make sure compilers would be able to handle future C++17 features. --- src/main.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 70ecddd..cbc85c6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -348,15 +348,6 @@ int main( int argc, char* argv[] ) { setUpLogging( argc, argv ); - // Initializers in if statements is a C++17 feature. Should be removed after - // making sure CI works with this. - if ( constexpr int i = 2; i > 10 ) - { - // static_assert with no message is a C++17 feature. Should be removed - // after making sure CI works with this. - static_assert( i < 5 ); - } - const bool desktopMode = argument::CheckCommandLineArgument( argc, argv, argument::kDesktopMode ); const bool noSound From 5f17377329f0bb3cfc97f4c8d5c188677b17c8f9 Mon Sep 17 00:00:00 2001 From: Vasily Date: Wed, 23 Jan 2019 22:44:09 +0100 Subject: [PATCH 9/9] Add explanation to disabled warning in .pro file MSVC does not yet support non experimental ways of selectively disabling warnings for some files. --- advancedSettings.pro | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/advancedSettings.pro b/advancedSettings.pro index 05c41b6..4c17b2a 100644 --- a/advancedSettings.pro +++ b/advancedSettings.pro @@ -20,7 +20,8 @@ TEMPLATE = app #D9025: overriding '/W4' with '/W3' QMAKE_CFLAGS_WARN_ON -= -W3 QMAKE_CXXFLAGS_WARN_ON -= -W3 - #C4127 was in a third party file with no way to turn off. + #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