Pārlūkot izejas kodu

Fixing a compilation issue caused by audio plugin dllexport refactor

BearishSun 9 gadi atpakaļ
vecāks
revīzija
e3291898a4

+ 7 - 7
Source/BansheeCore/Include/BsCommonTypes.h

@@ -392,13 +392,13 @@ namespace BansheeEngine
 		UINT32 numArraySlices;
 		UINT32 numArraySlices;
 	};
 	};
 
 
-	/** Meta-data describing a chunk of audio. */
-	struct AudioDataInfo
-	{
-		UINT32 numSamples; /**< Total number of audio samples in the audio data (includes all channels). */
-		UINT32 sampleRate; /**< Number of audio samples per second, per channel. */
-		UINT32 numChannels; /**< Number of channels. Each channel has its own set of samples. */
-		UINT32 bitDepth; /**< Number of bits per sample. */
+	/** Meta-data describing a chunk of audio. */
+	struct AudioDataInfo
+	{
+		UINT32 numSamples; /**< Total number of audio samples in the audio data (includes all channels). */
+		UINT32 sampleRate; /**< Number of audio samples per second, per channel. */
+		UINT32 numChannels; /**< Number of channels. Each channel has its own set of samples. */
+		UINT32 bitDepth; /**< Number of bits per sample. */
 	};
 	};
 
 
 	/** Helper class for syncing dirty data from sim CoreObject to core CoreObject and other way around. */
 	/** Helper class for syncing dirty data from sim CoreObject to core CoreObject and other way around. */

+ 3 - 0
Source/BansheeFMOD/CMakeLists.txt

@@ -19,6 +19,9 @@ include_directories(${BansheeFMOD_INC})
 # Target
 # Target
 add_library(BansheeFMOD SHARED ${BS_BANSHEEFMOD_SRC})
 add_library(BansheeFMOD SHARED ${BS_BANSHEEFMOD_SRC})
 
 
+# Defines
+target_compile_definitions(BansheeFMOD PRIVATE -DBS_FMOD_EXPORTS)
+
 # Libraries
 # Libraries
 ## External libs: FMOD, Vorbis, Ogg
 ## External libs: FMOD, Vorbis, Ogg
 add_library(FMOD STATIC IMPORTED)
 add_library(FMOD STATIC IMPORTED)

+ 17 - 0
Source/BansheeFMOD/Include/BsFMODPrerequisites.h

@@ -4,6 +4,23 @@
 
 
 #include "BsCorePrerequisites.h"
 #include "BsCorePrerequisites.h"
 
 
+#if (BS_PLATFORM == BS_PLATFORM_WIN32) && !defined(__MINGW32__)
+#	ifdef BS_FMOD_EXPORTS
+#		define BS_FMOD_EXPORT __declspec(dllexport)
+#	else
+#       if defined( __MINGW32__ )
+#           define BS_FMOD_EXPORT
+#       else
+#    		define BS_FMOD_EXPORT __declspec(dllimport)
+#       endif
+#	endif
+#elif defined (BS_GCC_VISIBILITY)
+#    define BS_FMOD_EXPORT  __attribute__ ((visibility("default")))
+#else
+#    define BS_FMOD_EXPORT
+#endif
+
+
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
 	class FMODAudioListener;
 	class FMODAudioListener;

+ 1 - 1
Source/BansheeFMOD/Source/BsFMODPlugin.cpp

@@ -8,7 +8,7 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
-	class BS_FMOD_EXPORT FMODFactory : public AudioFactory
+	class FMODFactory : public AudioFactory
 	{
 	{
 	public:
 	public:
 		void startUp() override
 		void startUp() override

+ 3 - 0
Source/BansheeOpenAudio/CMakeLists.txt

@@ -16,6 +16,9 @@ include_directories(${BansheeOpenAudio_INC})
 # Target
 # Target
 add_library(BansheeOpenAudio SHARED ${BS_BANSHEEOPENAUDIO_SRC})
 add_library(BansheeOpenAudio SHARED ${BS_BANSHEEOPENAUDIO_SRC})
 
 
+# Defines
+target_compile_definitions(BansheeOpenAudio PRIVATE -DBS_OA_EXPORTS)
+
 # Libraries
 # Libraries
 ## External libs: FLAC, Vorbis, Ogg, OpenAL
 ## External libs: FLAC, Vorbis, Ogg, OpenAL
 add_library_per_config(BansheeOpenAudio libFLAC libFLAC libFLAC)
 add_library_per_config(BansheeOpenAudio libFLAC libFLAC libFLAC)

+ 16 - 0
Source/BansheeOpenAudio/Include/BsOAPrerequisites.h

@@ -4,6 +4,22 @@
 
 
 #include "BsCorePrerequisites.h"
 #include "BsCorePrerequisites.h"
 
 
+#if (BS_PLATFORM == BS_PLATFORM_WIN32) && !defined(__MINGW32__)
+#	ifdef BS_OA_EXPORTS
+#		define BS_OA_EXPORT __declspec(dllexport)
+#	else
+#       if defined( __MINGW32__ )
+#           define BS_OA_EXPORT
+#       else
+#    		define BS_OA_EXPORT __declspec(dllimport)
+#       endif
+#	endif
+#elif defined ( BS_GCC_VISIBILITY )
+#    define BS_OA_EXPORT  __attribute__ ((visibility("default")))
+#else
+#    define BS_OA_EXPORT
+#endif
+
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
 	class OAAudioListener;
 	class OAAudioListener;

+ 3 - 3
Source/BansheeOpenAudio/Source/BsOAPlugin.cpp

@@ -23,14 +23,14 @@ namespace BansheeEngine
 	};
 	};
 
 
 	/**	Returns a name of the plugin. */
 	/**	Returns a name of the plugin. */
-	extern "C" const char* getPluginName()
+	extern "C" BS_OA_EXPORT const char* getPluginName()
 	{
 	{
 		static const char* pluginName = "OpenAudio";
 		static const char* pluginName = "OpenAudio";
 		return pluginName;
 		return pluginName;
 	}
 	}
 
 
 	/**	Entry point to the plugin. Called by the engine when the plugin is loaded. */
 	/**	Entry point to the plugin. Called by the engine when the plugin is loaded. */
-	extern "C" void* loadPlugin()
+	extern "C" BS_OA_EXPORT void* loadPlugin()
 	{
 	{
 		OAImporter* importer = bs_new<OAImporter>();
 		OAImporter* importer = bs_new<OAImporter>();
 		Importer::instance()._registerAssetImporter(importer);
 		Importer::instance()._registerAssetImporter(importer);
@@ -39,7 +39,7 @@ namespace BansheeEngine
 	}
 	}
 
 
 	/**	Exit point of the plugin. Called by the engine before the plugin is unloaded. */
 	/**	Exit point of the plugin. Called by the engine before the plugin is unloaded. */
-	extern "C" void unloadPlugin(OAFactory* instance)
+	extern "C" BS_OA_EXPORT void unloadPlugin(OAFactory* instance)
 	{
 	{
 		bs_delete(instance);
 		bs_delete(instance);
 	}
 	}