Commit ca1f6770 authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Adding static build switch

parent 6db8a298
......@@ -7,10 +7,24 @@ list( APPEND CMAKE_MODULE_PATH "$ENV{VISTA_CMAKE_COMMON}" )
include( VistaCommon )
if( NOT DEFINED ITA_CORE_LIBS_BUILD_STATIC )
set( ITA_CORE_LIBS_BUILD_STATIC OFF CACHE BOOL "Build all ITA core libs in static mode" )
endif( NOT DEFINED ITA_CORE_LIBS_BUILD_STATIC )
if( NOT DEFINED ITA_VISTA_BUILD_STATIC )
set( ITA_VISTA_BUILD_STATIC OFF CACHE BOOL "Build against static ViSTA libraries" )
endif( NOT DEFINED ITA_VISTA_BUILD_STATIC )
if( NOT DEFINED ITA_VA_BUILD_STATIC )
set( ITA_VA_BUILD_STATIC OFF CACHE BOOL "Build static VA libs" )
endif( NOT DEFINED ITA_VA_BUILD_STATIC )
if( NOT DEFINED ITA_VACORE_INSTALL_WITH_DLLS )
set( ITA_VACORE_INSTALL_WITH_DLLS ON CACHE BOOL "Install VACore with depending DLLs (use this switch with care)" )
endif( NOT DEFINED ITA_VACORE_INSTALL_WITH_DLLS )
# Required packages
vista_use_package( VistaCoreLibs REQUIRED COMPONENTS VistaInterProcComm FIND_DEPENDENCIES )
vista_use_package( VABase REQUIRED FIND_DEPENDENCIES )
......@@ -145,8 +159,27 @@ include( "src/_SourceFiles.cmake" )
include_directories( "include" )
if( ITA_CORE_LIBS_BUILD_STATIC )
add_definitions( -DITA_BASE_STATIC -DITA_DATA_SOURCES_STATIC -DITA_DIFFRACTION_STATIC -DITA_GEO_STATIC -DITA_CONVOLUTION_STATIC -DITA_FFT_STATIC -DITA_CTC_STATIC -DITA_SAMPLER_STATIC )
endif( ITA_CORE_LIBS_BUILD_STATIC )
if( ITA_VISTA_BUILD_STATIC )
add_definitions( -DVISTABASE_STATIC -DVISTAMATH_STATIC -DVISTAASPECTS_STATIC -DVISTATOOLS_STATIC -DVISTAINTERPROCCOMM_STATIC )
endif( ITA_VISTA_BUILD_STATIC )
add_definitions( -DIEEE754_64FLOAT=1 )
add_definitions( -DVABASE_DLL -DITA_DATA_SOURCES_DLL -DITA_BASE_DLL -DITA_CONVOLUTION_DLL -DITA_CTC_DLL -DITA_SAMPLER_DLL -DVACORE_DLL -DVACORE_EXPORTS )
if( NOT ITA_VA_BUILD_STATIC )
add_definitions( -DVACORE_EXPORTS )
else( NOT ITA_VA_BUILD_STATIC )
add_definitions( -DVABASE_STATIC -DVACORE_STATIC )
set( BUILD_SHARED_LIBS_TEMP ${BUILD_SHARED_LIBS} )
if( BUILD_SHARED_LIBS )
set( BUILD_SHARED_LIBS OFF )
message( "Ignoring activated BUILD_SHARED_LIBS temporary because static VA requested" )
endif( BUILD_SHARED_LIBS )
endif( NOT ITA_VA_BUILD_STATIC )
add_definitions( "-DVACORE_DEFAULT_LOG_LEVEL=${ITA_VACORE_DEFAULT_DEBUG_LEVEL}" )
add_definitions( "-DVACORE_VERSION_MAJOR=${ITA_VACORE_VERSION_MAJOR}" )
......@@ -239,7 +272,9 @@ vista_add_files_to_sources( ProjectSources "conf" NON_RECURSIVE SOURCE_GROUP "co
vista_add_files_to_sources( ProjectSources "data" SOURCE_GROUP_MIRROR_DIR "data" "wav" "daff" "mat" "ac" "skp" )
add_library( VACore ${ProjectSources} )
target_link_libraries( VACore ${VISTA_USE_PACKAGE_LIBRARIES} ) # contains all libraries from vista_use_package() calls
target_link_libraries( VACore ${VISTA_USE_PACKAGE_LIBRARIES} ) # contains all libraries from vista_use_package() calls
set( BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_TEMP} )
vista_configure_lib( VACore )
set( VACORE_INCLUDE_OUTDIR "${CMAKE_CURRENT_SOURCE_DIR}/include" )
......
/*
* --------------------------------------------------------------------------------------------
*
* VVV VVV A
* VVV VVV AAA Virtual Acoustics
* VVV VVV AAA Real-time auralisation for virtual reality
* VVV VVV AAA Virtual Acoustics (VA)
* VVV VVV AAA Real-time auralisation for virtual reality
* VVV VVV AAA
* VVVVVV AAA (c) Copyright Institut fr Technische Akustik (ITA)
* VVVV AAA RWTH Aachen (http://www.akustik.rwth-aachen.de)
* VVVVVV AAA (c) Copyright Institute of Technical Acoustics (ITA)
* VVVV AAA RWTH Aachen University (http://www.akustik.rwth-aachen.de)
*
* ---------------------------------------------------------------------------------
*
* Datei: VACoreDefinitions.h
*
* Zweck: Globale Definitionen und Funktionen des VA-Kerns
*
* Autor(en): Frank Wefers (Frank.Wefers@akustik.rwth-aachen.de)
*
* ---------------------------------------------------------------------------------
* --------------------------------------------------------------------------------------------
*/
// $Id: VACoreDefinitions.h 2900 2012-09-17 08:42:42Z fwefers $
#ifndef __VACORE_DEFINITIONS_H__
#define __VACORE_DEFINITIONS_H__
#ifndef VA_INCLUDE_GUARD_VACORE_DEFINITIONS
#define VA_INCLUDE_GUARD_VACORE_DEFINITIONS
#include <string>
#include <vector>
// Import-/Export-Konventionen fr die Bibliothek definieren
#ifdef VACORE_DLL
// Dynamische Bibliothek
#if ( defined WIN32 ) && !( defined VACORE_STATIC )
#ifdef VACORE_EXPORTS
#define VACORE_API __declspec(dllexport)
#define VACORE_API __declspec( dllexport )
#else
#define VACORE_API __declspec(dllimport)
#define VACORE_API __declspec( dllimport )
#endif
#else
// Statische Bibliothek
#define VACORE_API
#endif
// Disable STL template-instantiiation warning with DLLs for Visual C++
#if defined (_MSC_VER)
#pragma warning(disable: 4251)
#if defined( _MSC_VER )
#pragma warning( disable: 4251 )
#endif
#endif // __VACORE_DEFINITIONS_H__
#endif // VA_INCLUDE_GUARD_VACORE_DEFINITIONS
......@@ -390,6 +390,6 @@ private:
VA_REGISTER_AUDIO_RENDERER( CVAPTHearingAidRenderer, "PrototypeHearingAid" );
#endif // (VACORE_WITH_RENDERER_HEARING_AID==1)
#endif // ( VACORE_WITH_RENDERER_PROTOTYPE_HEARING_AID == 1 )
#endif // __VA_PROTOTYPE_HEARINGAID_RENDERER__
......@@ -103,17 +103,25 @@ public:
//! Audio renderer default factory (template)
template <class T>
class CVAAudioRendererDefaultFactory : IVAAudioRendererFactory {
template< class T >
class CVAAudioRendererDefaultFactory : IVAAudioRendererFactory
{
public:
CVAAudioRendererDefaultFactory( const std::string& sClassName )
: m_sClassName(sClassName)
inline CVAAudioRendererDefaultFactory( const std::string& sClassName )
: m_sClassName( sClassName )
{
CVAAudioRendererRegistry::GetInstance()->RegisterFactory( this );
}
};
std::string GetClassName() const { return m_sClassName; }
IVAAudioRenderer* Create(const CVAAudioRendererInitParams& oParams) { return new T(oParams); }
inline std::string GetClassName() const
{
return m_sClassName;
};
inline IVAAudioRenderer* Create( const CVAAudioRendererInitParams& oParams )
{
return new T( oParams );
};
private:
std::string m_sClassName;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment