From 9c81467fe921859df7ef3a4c5ca3dc2f55d7142b Mon Sep 17 00:00:00 2001 From: Roland Winklmeier Date: Fri, 10 Apr 2015 21:53:56 +0200 Subject: [PATCH] refs #403 add BlackInput shared library build --- src/blackinput/blackinput.pro | 4 +++- src/blackinput/blackinputexport.h | 27 +++++++++++++++++++++++++ src/blackinput/joystick.h | 3 ++- src/blackinput/keyboard.h | 3 ++- src/blackinput/win/joystick_windows.h | 3 ++- src/blackinput/win/keyboard_windows.h | 3 ++- src/blackinput/win/keymapping_windows.h | 3 ++- 7 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 src/blackinput/blackinputexport.h diff --git a/src/blackinput/blackinput.pro b/src/blackinput/blackinput.pro index a5920ec30..6583fb994 100644 --- a/src/blackinput/blackinput.pro +++ b/src/blackinput/blackinput.pro @@ -19,7 +19,7 @@ precompile_header:!isEmpty(PRECOMPILED_HEADER) { DEFINES += USING_PCH } -DEFINES += LOG_IN_FILE +DEFINES += LOG_IN_FILE BUILD_BLACKINPUT_LIB HEADERS += *.h SOURCES += *.cpp @@ -27,6 +27,8 @@ SOURCES += *.cpp win32 { HEADERS += $$PWD/win/*.h SOURCES += $$PWD/win/*.cpp + + LIBS *= -ldxguid -lole32 -ldinput8 -lUser32 } unix:!macx { diff --git a/src/blackinput/blackinputexport.h b/src/blackinput/blackinputexport.h new file mode 100644 index 000000000..85dedbe17 --- /dev/null +++ b/src/blackinput/blackinputexport.h @@ -0,0 +1,27 @@ +/* Copyright (C) 2015 + * swift project Community / Contributors + * + * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level + * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, + * including this file, may be copied, modified, propagated, or distributed except according to the terms + * contained in the LICENSE file. + */ + +//! \file + +#ifndef BLACKINPUT_MACROS_H +#define BLACKINPUT_MACROS_H + +#include + +#ifndef WITH_STATIC +# if defined(BUILD_BLACKINPUT_LIB) +# define BLACKINPUT_EXPORT Q_DECL_EXPORT +# else +# define BLACKINPUT_EXPORT Q_DECL_IMPORT +# endif +#else +# define BLACKINPUT_EXPORT +#endif + +#endif // BLACKINPUT_MACROS_H diff --git a/src/blackinput/joystick.h b/src/blackinput/joystick.h index 12d0015b3..9ce0a0dcb 100644 --- a/src/blackinput/joystick.h +++ b/src/blackinput/joystick.h @@ -12,6 +12,7 @@ #ifndef BLACKINPUT_JOYSTICK_H #define BLACKINPUT_JOYSTICK_H +#include "blackinputexport.h" #include "blackmisc/hardware/joystickbutton.h" #include #include @@ -24,7 +25,7 @@ namespace BlackInput * \brief Abstract interface for native joystick handling. * \todo Add implementation for Linux and OSX. */ - class IJoystick : public QObject + class BLACKINPUT_EXPORT IJoystick : public QObject { Q_OBJECT diff --git a/src/blackinput/keyboard.h b/src/blackinput/keyboard.h index 0854e5922..ff3204a99 100644 --- a/src/blackinput/keyboard.h +++ b/src/blackinput/keyboard.h @@ -10,6 +10,7 @@ #ifndef BLACKINPUT_KEYBOARD_H #define BLACKINPUT_KEYBOARD_H +#include "blackinputexport.h" #include "blackmisc/hardware/keyboardkeylist.h" #include #include @@ -22,7 +23,7 @@ namespace BlackInput * Abstract interface for native keyboard handling. * \todo Add implementation for Linux and OSX. */ - class IKeyboard : public QObject + class BLACKINPUT_EXPORT IKeyboard : public QObject { Q_OBJECT public: diff --git a/src/blackinput/win/joystick_windows.h b/src/blackinput/win/joystick_windows.h index b42b6adc5..2d5aa8af6 100644 --- a/src/blackinput/win/joystick_windows.h +++ b/src/blackinput/win/joystick_windows.h @@ -12,6 +12,7 @@ //! \file +#include "blackinput/blackinputexport.h" #include "blackinput/joystick.h" #include "blackmisc/hardware/joystickbutton.h" #include "blackmisc/collection.h" @@ -46,7 +47,7 @@ namespace BlackInput bool operator == (CJoystickDeviceData const &lhs, CJoystickDeviceData const &rhs); //! Windows implemenation of IJoystick with DirectInput - class CJoystickWindows : public IJoystick + class BLACKINPUT_EXPORT CJoystickWindows : public IJoystick { Q_OBJECT diff --git a/src/blackinput/win/keyboard_windows.h b/src/blackinput/win/keyboard_windows.h index 10b3c2ea7..0a3f759ba 100644 --- a/src/blackinput/win/keyboard_windows.h +++ b/src/blackinput/win/keyboard_windows.h @@ -10,6 +10,7 @@ #ifndef BLACKINPUT_KEYBOARD_WINDOWS_H #define BLACKINPUT_KEYBOARD_WINDOWS_H +#include "blackinput/blackinputexport.h" #include "blackinput/keyboard.h" #include "blackmisc/hardware/keyboardkey.h" #include "blackmisc/hardware/keyboardkeylist.h" @@ -23,7 +24,7 @@ namespace BlackInput { //! \brief Windows implemenation of IKeyboard using hook procedure //! \todo Change QHash to a CCollection object - class CKeyboardWindows : public IKeyboard + class BLACKINPUT_EXPORT CKeyboardWindows : public IKeyboard { Q_OBJECT public: diff --git a/src/blackinput/win/keymapping_windows.h b/src/blackinput/win/keymapping_windows.h index ba087b210..8ef5006a2 100644 --- a/src/blackinput/win/keymapping_windows.h +++ b/src/blackinput/win/keymapping_windows.h @@ -7,6 +7,7 @@ #ifndef BLACKINPUT_KEYMAPPING_WINDOWS_H #define BLACKINPUT_KEYMAPPING_WINDOWS_H +#include "blackinput/blackinputexport.h" #include "blackmisc/hardware/keyboardkey.h" #ifndef NOMINMAX #define NOMINMAX @@ -16,7 +17,7 @@ namespace BlackInput { //! \brief This class provides methods to map between windows virtual keys and CKeyboardKey - class CKeyMappingWindows + class BLACKINPUT_EXPORT CKeyMappingWindows { public: /*!