diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2014-08-30 10:19:10 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2014-08-30 10:22:12 +0200 |
commit | 0027139d8348e07e6a2d9734489964961294fe22 (patch) | |
tree | 490a4b215f6005e7f444f4f97cddaf60f357fcd0 | |
parent | 512d269886e2d27c105157ef0db926fe03d48f70 (diff) |
remove MSVC support
Leave as-is to avoid unconditionally assuming GNU extensions and ABI
-rw-r--r-- | CMakeLists.txt | 99 | ||||
-rw-r--r-- | facetracknoir/facetracknoir.cpp | 2 | ||||
-rw-r--r-- | facetracknoir/main.cpp | 26 | ||||
-rw-r--r-- | facetracknoir/plugin-support.h | 8 | ||||
-rwxr-xr-x | ftnoir_filter_kalman/ftnoir_filter_kalman.h | 8 | ||||
-rw-r--r-- | ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc.h | 2 | ||||
-rw-r--r-- | ftnoir_protocol_sc/ftnoir_protocol_sc.cpp | 2 | ||||
-rw-r--r-- | ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h | 11 | ||||
-rw-r--r-- | ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp | 2 | ||||
-rw-r--r-- | ftnoir_tracker_base/ftnoir_tracker_base_global.h | 2 | ||||
-rw-r--r-- | ftnoir_tracker_hydra/ftnoir_tracker_hydra.h | 6 | ||||
-rw-r--r-- | opentrack-api/context.cpp | 2 |
12 files changed, 26 insertions, 144 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f0e401aa..647a3449 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,10 @@ project(opentrack) cmake_minimum_required(VERSION 2.8.11) cmake_policy(SET CMP0020 NEW) +if(MSVC) + message(FATAL_ERROR "Support for MSVC removed due to incomplete C++11 support") +endif() + include(CMakeParseArguments) set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_SOURCE_DIR}/cmake/") @@ -47,43 +51,10 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON) add_definitions(-DOPENTRACK_API -DIN_OPENTRACK) -if(MSVC) - add_definitions(-DNOMINMAX) -endif() - if(CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE) add_definitions(-std=c++11) endif() -if(WIN32 AND MSVC) - set(SDK_GOOGLE_BREAKPAD "" CACHE PATH "google-breakpad for crash reporting") -endif() - -if(SDK_GOOGLE_BREAKPAD AND WIN32) - add_definitions(-DOPENTRACK_BREAKPAD) - include_directories("${SDK_GOOGLE_BREAKPAD}/src/client/windows/handler") - include_directories("${SDK_GOOGLE_BREAKPAD}/src/") -endif() - -if(WIN32 AND DEFINED MSVC_VERSION AND NOT ${MSVC_VERSION} LESS 1700) - find_path (WIN8_SDK_ROOT_DIR - Include/um/windows.h - PATHS - "$ENV{ProgramFiles}/Windows Kits/8.0" - "$ENV{ProgramFiles(x86)}/Windows Kits/8.0" - DOC "Windows 8 SDK root directory" - ) - - if(WIN8_SDK_ROOT_DIR) - SET(CMAKE_LIBRARY_PATH "${WIN8_SDK_ROOT_DIR}/Lib/win8/um/x86") - endif() -endif() - -if(WIN32 AND DEFINED MSVC_VERSION AND NOT ${MSVC_VERSION} LESS 1700) - SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO") - SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO") - SET (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO") -endif() if(UNIX) set(SDK_ENABLE_LIBEVDEV FALSE CACHE BOOL "libevdev virtual joystick protocol support (probably Linux only)") @@ -162,15 +133,7 @@ set(EXTRA-MOCS "${CMAKE_SOURCE_DIR}/facetracknoir/options.h") function(link_with_dinput8 n) if(WIN32) - if(MSVC) - target_link_libraries(${n} - "${CMAKE_SOURCE_DIR}/dinput/dinput8.lib" - "${CMAKE_SOURCE_DIR}/dinput/dxguid.lib" - "${CMAKE_SOURCE_DIR}/dinput/strmiids.lib" - uuid) - else() - target_link_libraries(${n} dinput8 dxguid strmiids) - endif() + target_link_libraries(${n} dinput8 dxguid strmiids) endif() endfunction() @@ -306,11 +269,7 @@ opentrack_library(opentrack-proto-fgfs) if(SDK_VJOY) include_directories(${SDK_VJOY}) opentrack_library(opentrack-proto-vjoy) - if(MSVC) - target_link_libraries(opentrack-proto-vjoy ${MY_QT_LIBS} "${SDK_VJOY}/VJoy.lib") - else() - target_link_libraries(opentrack-proto-vjoy ${MY_QT_LIBS} "${SDK_VJOY}/VJoy.dll") - endif() + target_link_libraries(opentrack-proto-vjoy ${MY_QT_LIBS} "${SDK_VJOY}/VJoy.dll") endif() if(SDK_ENABLE_LIBEVDEV) @@ -321,9 +280,6 @@ if(SDK_ENABLE_LIBEVDEV) endif() if(SDK_FSUIPC) - if(MSVC) - set(link-flags "/NODEFAULTLIB:libc") - endif() opentrack_library(opentrack-proto-fsuipc LINK "${link-flags}") target_link_libraries(opentrack-proto-fsuipc "${SDK_FSUIPC}/FSUIPC_User.lib") endif() @@ -384,12 +340,6 @@ if(SDK_ARUCO_LIBPATH) include_directories(${CMAKE_SOURCE_DIR}/ftnoir_tracker_aruco/include) opentrack_library(opentrack-tracker-aruco) target_link_libraries(opentrack-tracker-aruco ${SDK_ARUCO_LIBPATH} ${OpenCV_LIBS}) - if(WIN32 AND MSVC) - target_link_libraries(opentrack-tracker-aruco - "${CMAKE_SOURCE_DIR}/dinput/dxguid.lib" - "${CMAKE_SOURCE_DIR}/dinput/strmiids.lib" - uuid) - endif() endif() link_with_dinput8(opentrack-tracker-ht) @@ -411,24 +361,16 @@ if(SDK_RIFT) set(link-flags "-framework CoreFoundation -framework CoreGraphics -framework IOKit -framework Quartz") set(c-flags "-fno-strict-aliasing") else() - if(MSVC) - set(link-flags "/NODEFAULTLIB:LIBCMT") - else() - set(c-flags "-fno-strict-aliasing") - endif() + set(c-flags "-fno-strict-aliasing") endif() opentrack_library(opentrack-tracker-rift LINK "${link-flags}" COMPILE "${c-flags}") - if(MSVC) - target_link_libraries(opentrack-tracker-rift "${SDK_RIFT}/Lib/Win32/libovr.lib" winmm.lib setupapi.lib) + if(WIN32) + target_link_libraries(opentrack-tracker-rift "${SDK_RIFT}/libLibOVR.a" winmm setupapi ws2_32 imagehlp wbemuuid) else() - if(WIN32) - target_link_libraries(opentrack-tracker-rift "${SDK_RIFT}/libLibOVR.a" winmm setupapi) + if(NOT APPLE) + target_link_libraries(opentrack-tracker-rift "${SDK_RIFT}/libLibOVR.a" udev Xinerama) else() - if(NOT APPLE) - target_link_libraries(opentrack-tracker-rift "${SDK_RIFT}/libLibOVR.a" udev Xinerama) - else() - target_link_libraries(opentrack-tracker-rift "${SDK_RIFT}/libLibOVR.a") - endif() + target_link_libraries(opentrack-tracker-rift "${SDK_RIFT}/libLibOVR.a") endif() endif() endif() @@ -516,22 +458,11 @@ if(CMAKE_SYSTEM STREQUAL LINUX) link_libraries(rt) endif() -if(MSVC) - SET_TARGET_PROPERTIES(opentrack PROPERTIES LINK_FLAGS "/ENTRY:mainCRTStartup") -endif() target_link_libraries(opentrack opentrack-pose-widget opentrack-spline-widget ${MY_QT_LIBS} ${QXT_QXTCORE_LIB_RELEASE} ${QXT_QXTWIDGETS_LIB_RELEASE}) if(NOT WIN32) target_link_libraries(opentrack dl) target_link_libraries(opentrack-api dl) endif() -if(SDK_GOOGLE_BREAKPAD) - if(MSVC) - target_link_libraries(opentrack - "${SDK_GOOGLE_BREAKPAD}/src/client/windows/Release/lib/crash_generation_client.lib" - "${SDK_GOOGLE_BREAKPAD}/src/client/windows/Release/lib/exception_handler.lib" - "${SDK_GOOGLE_BREAKPAD}/src/client/windows/Release/lib/common.lib") - endif() -endif() # make install @@ -573,9 +504,3 @@ endif() if(WIN32) install(FILES "${CMAKE_SOURCE_DIR}/bin/cleye.config" DESTINATION .) endif() - -if(MSVC) - file(GLOB pdbs1 "${CMAKE_BINARY_DIR}/Release/*.pdb") - file(GLOB pdbs2 "${CMAKE_BINARY_DIR}/*.pdb") - install(FILES ${pdbs1} ${pdbs2} DESTINATION .) -endif() diff --git a/facetracknoir/facetracknoir.cpp b/facetracknoir/facetracknoir.cpp index 00a7b95e..d717b3be 100644 --- a/facetracknoir/facetracknoir.cpp +++ b/facetracknoir/facetracknoir.cpp @@ -44,7 +44,7 @@ #include <iostream> #ifdef _MSC_VER -# define LIB_PREFIX "" +# error "No support for MSVC anymore" #else # define LIB_PREFIX "lib" #endif diff --git a/facetracknoir/main.cpp b/facetracknoir/main.cpp index 3143a093..9bf11b32 100644 --- a/facetracknoir/main.cpp +++ b/facetracknoir/main.cpp @@ -32,34 +32,8 @@ #include <QStringList> #include <memory> -#if defined(_WIN32) && defined(_MSC_VER) -# include <windows.h> -# ifdef OPENTRACK_BREAKPAD -# include <exception_handler.h> -using namespace google_breakpad; -bool dumpCallback(const wchar_t* dump_path, - const wchar_t* minidump_id, - void* context, - EXCEPTION_POINTERS* exinfo, - MDRawAssertionInfo* assertion, - bool succeeded) -{ - MessageBoxA(GetDesktopWindow(), - "Generating crash dump!\r\n" - "Please send the .dmp file to <sthalik@misaki.pl> to help us improve the code.", - "opentrack crashed :(", - MB_OK | MB_ICONERROR); - return succeeded; -} - -# endif -#endif - int main(int argc, char** argv) { -#if defined(OPENTRACK_BREAKPAD) && defined(_MSC_VER) - auto handler = new ExceptionHandler(L".", nullptr, dumpCallback, nullptr, -1); -#endif QApplication::setAttribute(Qt::AA_X11InitThreads, true); QApplication app(argc, argv); auto w = std::make_shared<FaceTrackNoIR>(); diff --git a/facetracknoir/plugin-support.h b/facetracknoir/plugin-support.h index 4394d1a0..1c63151a 100644 --- a/facetracknoir/plugin-support.h +++ b/facetracknoir/plugin-support.h @@ -3,7 +3,7 @@ #if defined(_WIN32) # define CALLING_CONVENTION_SUFFIX_VOID_FUNCTION "@0" # ifdef _MSC_VER -# define MAYBE_STDCALL_UNDERSCORE "_" +# error "No support for MSVC anymore" #else # define MAYBE_STDCALL_UNDERSCORE "" # endif @@ -12,12 +12,6 @@ # define MAYBE_STDCALL_UNDERSCORE "" #endif -#ifdef _MSC_VER -# define virt_override -#else -# define virt_override override -#endif - #include <cstdio> #include <QWidget> diff --git a/ftnoir_filter_kalman/ftnoir_filter_kalman.h b/ftnoir_filter_kalman/ftnoir_filter_kalman.h index e4b27d1f..9964d6f2 100755 --- a/ftnoir_filter_kalman/ftnoir_filter_kalman.h +++ b/ftnoir_filter_kalman/ftnoir_filter_kalman.h @@ -25,9 +25,9 @@ class FTNOIR_FILTER_BASE_EXPORT FTNoIR_Filter : public IFilter { public: FTNoIR_Filter(); - void reset() virt_override; + void reset() override; void FilterHeadPoseData(const double *target_camera_position, - double *new_camera_position) virt_override; + double *new_camera_position) override; cv::KalmanFilter kalman; double prev_position[6]; double prev2_filter_pos[6]; @@ -56,8 +56,8 @@ public: show(); } Ui::KalmanUICFilterControls ui; - virtual void registerFilter(IFilter*) virt_override {} - virtual void unregisterFilter() virt_override {} + virtual void registerFilter(IFilter*) override {} + virtual void unregisterFilter() override {} public slots: void doOK(); void doCancel(); diff --git a/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc.h b/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc.h index dcdd8098..6e0db58c 100644 --- a/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc.h +++ b/ftnoir_protocol_fsuipc/ftnoir_protocol_fsuipc.h @@ -67,7 +67,7 @@ class FTNoIR_Protocol : public IProtocol { public: FTNoIR_Protocol(); - virtual ~FTNoIR_Protocol() virt_override; + virtual ~FTNoIR_Protocol() override; bool checkServerInstallationOK(); void sendHeadposeToGame(const double* headpose); QString getGameName() { diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp b/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp index 7de762ac..c53aa49c 100644 --- a/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp +++ b/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp @@ -103,7 +103,7 @@ public: actx.lpResourceName = MAKEINTRESOURCEA(resid); actx.dwFlags = ACTCTX_FLAG_RESOURCE_NAME_VALID; #ifdef _MSC_VER -# define PREFIX "" +# error "MSVC support removed" #else # define PREFIX "lib" #endif diff --git a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h index 6ef828d4..c36b15f3 100644 --- a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h +++ b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.h @@ -106,17 +106,6 @@ typedef struct _JOYSTICK_STATE UINT32 Buttons; // 32 Buttons } JOYSTICK_STATE, * PJOYSTICK_STATE; -#include <poppack.h> - -#undef EXTERN_C -#if _MSC_VER -# define EXTERN_C -#else -# define EXTERN_C extern "C" -#endif -#if _MSC_VER -# pragma comment(linker, "/implib:vjoy.def") -#endif EXTERN_C BOOL __stdcall VJoy_Initialize(PCHAR name, PCHAR serial); EXTERN_C VOID __stdcall VJoy_Shutdown(); EXTERN_C BOOL __stdcall VJoy_UpdateJoyState(int id, PJOYSTICK_STATE pJoyState); diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp index 84b7eed3..18301b6a 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp @@ -325,7 +325,7 @@ void Tracker::run() last_roi.height = std::min<int>(grayscale.rows - last_roi.y, last_roi.height); } - cv::solvePnP(obj_points, m, intrinsics, dist_coeffs, rvec, tvec, !first, cv::ITERATIVE); + cv::solvePnP(obj_points, m, intrinsics, dist_coeffs, rvec, tvec, !first, cv::SOLVEPNP_ITERATIVE); first = false; cv::Mat rotation_matrix = cv::Mat::zeros(3, 3, CV_64FC1); cv::Mat junk1(3, 3, CV_64FC1), junk2(3, 3, CV_64FC1); diff --git a/ftnoir_tracker_base/ftnoir_tracker_base_global.h b/ftnoir_tracker_base/ftnoir_tracker_base_global.h index 6d6a1918..5b53ba82 100644 --- a/ftnoir_tracker_base/ftnoir_tracker_base_global.h +++ b/ftnoir_tracker_base/ftnoir_tracker_base_global.h @@ -8,7 +8,7 @@ # if !defined(_MSC_VER) # define FTNOIR_TRACKER_BASE_EXPORT __attribute__ ((visibility ("default"))) Q_DECL_EXPORT # else -# define FTNOIR_TRACKER_BASE_EXPORT Q_DECL_EXPORT +# error "MSVC support removed" # endif # else # define FTNOIR_TRACKER_BASE_EXPORT Q_DECL_IMPORT diff --git a/ftnoir_tracker_hydra/ftnoir_tracker_hydra.h b/ftnoir_tracker_hydra/ftnoir_tracker_hydra.h index 90574a4b..7819dd67 100644 --- a/ftnoir_tracker_hydra/ftnoir_tracker_hydra.h +++ b/ftnoir_tracker_hydra/ftnoir_tracker_hydra.h @@ -26,8 +26,8 @@ class Hydra_Tracker : public ITracker public: Hydra_Tracker(); ~Hydra_Tracker(); - void StartTracker(QFrame *) virt_override; - void GetHeadPoseData(double *data) virt_override; + void StartTracker(QFrame *) override; + void GetHeadPoseData(double *data) override; volatile bool should_quit; protected: void run(); // qthread override run method @@ -36,7 +36,7 @@ private: bool isCalibrated; double newHeadPose[6]; // Structure with new headpose QMutex mutex; - virtual int preferredHz() virt_override { return 250; } + virtual int preferredHz() override { return 250; } }; class TrackerControls: public QWidget, public ITrackerDialog diff --git a/opentrack-api/context.cpp b/opentrack-api/context.cpp index 04fa5ac2..b706ad3a 100644 --- a/opentrack-api/context.cpp +++ b/opentrack-api/context.cpp @@ -12,7 +12,7 @@ #include <iostream> #ifdef _MSC_VER -# define LIB_PREFIX "" +# error "MSVC support removed" #else # define LIB_PREFIX "lib" #endif |