Fleshed out target_link_libraries dependencies between libraries. Appearance utility now reads avatar_lad.xml during stubbed out params processing.

master
Don Kjer 2012-09-13 10:25:48 +00:00
parent 929b7e0295
commit 8ba2b38876
26 changed files with 180 additions and 57 deletions

View File

@ -3,38 +3,27 @@
project(appearance_utility)
include(00-Common)
include(CURL)
include(CARes)
include(OpenSSL)
include(UI)
include(LLAppearance)
include(LLCharacter)
include(LLCommon)
include(LLImage)
include(LLInventory)
include(LLMath)
include(LLKDU)
include(LLRender)
include(LLVFS)
include(LLXML)
include(LLUI)
include(Linking)
include(GooglePerfTools)
include_directories(
${LLCOMMON_INCLUDE_DIRS}
${LLVFS_INCLUDE_DIRS}
${LLXML_INCLUDE_DIRS}
${LLUI_INCLUDE_DIRS}
${LLCHARACTER_INCLUDE_DIRS}
${LLKDU_INCLUDE_DIRS}
${LLIMAGE_INCLUDE_DIRS}
${LLMATH_INCLUDE_DIRS}
${LLINVENTORY_INCLUDE_DIRS}
${LLRENDER_INCLUDE_DIRS}
${CURL_INCLUDE_DIRS}
${CARES_INCLUDE_DIRS}
${OPENSSL_INCLUDE_DIRS}
${UI_INCLUDE_DIRS}
${LLAPPEARANCE_INCLUDE_DIRS}
)
@ -70,13 +59,7 @@ add_executable(appearance-utility-bin ${appearance_utility_SOURCE_FILES})
target_link_libraries(appearance-utility-bin
${LLAPPEARANCE_LIBRARIES}
${LLCHARACTER_LIBRARIES}
${LLRENDER_LIBRARIES}
${LLUI_LIBRARIES}
${UI_LIBRARIES}
${LLIMAGE_LIBRARIES}
${LLKDU_LIBRARIES}
${KDU_LIBRARY}
${TCMALLOC_LIBRARIES}
)
add_custom_target(appearance-utility-bin-target ALL

View File

@ -37,6 +37,10 @@
#include "llsdserialize.h"
#include "llsdutil.h"
// appearance includes
#include "llavatarappearance.h"
#include "llwearabletype.h"
// project includes
#include "llappappearanceutility.h"
#include "llbakingprocess.h"
@ -375,20 +379,43 @@ void LLAppAppearanceUtility::initializeIO()
///// END INPUT PARSING ////
}
class LLPassthroughTranslationBridge : public LLTranslationBridge
{
public:
virtual std::string getString(const std::string &xml_desc)
{
// Just pass back the input string.
return xml_desc;
}
};
bool LLAppAppearanceUtility::init()
{
parseArguments();
bool log_to_stderr = true;
LLError::initForApplication("", log_to_stderr);
// *TODO: Add debug mode(s). Skip this in debug mode.
LLError::setDefaultLevel(LLError::LEVEL_WARN);
validateArguments();
initializeIO();
// Initialize classes.
LLWearableType::initClass(new LLPassthroughTranslationBridge());
// *TODO: Create a texture bridge?
LLAvatarAppearance::initClass();
return true;
}
bool LLAppAppearanceUtility::cleanup()
{
LLAvatarAppearance::cleanupClass();
LLWearableType::cleanupClass();
if (mProcess)
{
delete mProcess;

View File

@ -38,6 +38,16 @@ class LLBakingAvatar : public LLAvatarAppearance
** INITIALIZATION
**/
public:
void* operator new(size_t size)
{
return ll_aligned_malloc_16(size);
}
void operator delete(void* ptr)
{
ll_aligned_free_16(ptr);
}
LLBakingAvatar(LLWearableData* wearable_data);
virtual ~LLBakingAvatar();

View File

@ -43,6 +43,7 @@ void LLProcessParams::process(LLSD& input, std::ostream& output)
{
LLWearableData wearable_data;
LLBakingAvatar avatar(&wearable_data);
avatar.initInstance();
LLSD result;
result["success"] = true;

View File

@ -8,6 +8,7 @@ include(CARes)
include(OpenSSL)
include(UI)
include(LLCommon)
include(LLMessage)
include(LLVFS)
include(LLXML)
include(LLUI)
@ -40,6 +41,7 @@ target_link_libraries(linux-updater
${CARES_LIBRARIES}
${OPENSSL_LIBRARIES}
${CRYPTO_LIBRARIES}
${LLMESSAGE_LIBRARIES}
${UI_LIBRARIES}
${LLXML_LIBRARIES}
${LLUI_LIBRARIES}

View File

@ -4,37 +4,24 @@ project(llappearance)
include(00-Common)
include(LLCommon)
include(LLAudio)
include(LLCharacter)
include(LLCommon)
include(LLImage)
include(LLImageJ2COJ)
include(LLInventory)
include(LLMath)
include(LLMessage)
include(LLPhysicsExtensions)
include(LLPlugin)
include(LLPrimitive)
include(LLRender)
include(LLUI)
include(LLVFS)
include(LLWindow)
include(LLXML)
include(Linking)
include(LLKDU)
include(ViewerMiscLibs)
include(LLLogin)
include_directories(
${LLCOMMON_INCLUDE_DIRS}
${LLCHARACTER_INCLUDE_DIRS}
${LLPHYSICS_INCLUDE_DIRS}
${LLIMAGE_INCLUDE_DIRS}
${LLKDU_INCLUDE_DIRS}
${LLINVENTORY_INCLUDE_DIRS}
${LLMATH_INCLUDE_DIRS}
${LLRENDER_INCLUDE_DIRS}
${LLUI_INCLUDE_DIRS}
${LLVFS_INCLUDE_DIRS}
${LLWINDOW_INCLUDE_DIRS}
${LLXML_INCLUDE_DIRS}
@ -90,6 +77,18 @@ list(APPEND llappearance_SOURCE_FILES ${llappearance_HEADER_FILES})
add_library (llappearance ${llappearance_SOURCE_FILES})
target_link_libraries(llappearance
${LLCHARACTER_LIBRARIES}
${LLINVENTORY_LIBRARIES}
${LLIMAGE_LIBRARIES}
${LLRENDER_LIBRARIES}
${LLVFS_LIBRARIES}
${LLMATH_LIBRARIES}
${LLXML_LIBRARIES}
${LLMATH_LIBRARIES}
${LLCOMMON_LIBRARIES}
)
#add unit tests
#if (LL_TESTS)
# INCLUDE(LLAddBuildTest)

View File

@ -419,6 +419,14 @@ void LLAvatarAppearance::initClass()
}
}
void LLAvatarAppearance::cleanupClass()
{
deleteAndClear(sAvatarXmlInfo);
// *TODO: What about sAvatarSkeletonInfo ???
sSkeletonXMLTree.cleanup();
sXMLTree.cleanup();
}
using namespace LLAvatarAppearanceDefines;
//------------------------------------------------------------------------

View File

@ -65,7 +65,8 @@ public:
LLAvatarAppearance(LLWearableData* wearable_data);
virtual ~LLAvatarAppearance();
static void initClass(); // initializes static members
static void initClass(); // initializes static members
static void cleanupClass(); // Cleanup data that's only init'd once per class.
virtual void initInstance(); // Called after construction to initialize the instance.
virtual BOOL loadSkeletonNode();
BOOL loadMeshNodes();

View File

@ -27,7 +27,19 @@
#include "linden_common.h"
#include "llwearabletype.h"
#include "llinventorytype.h"
#include "lltrans.h"
static LLTranslationBridge* sTrans = NULL;
// static
void LLWearableType::initClass(LLTranslationBridge* trans)
{
sTrans = trans;
}
void LLWearableType::cleanupClass()
{
delete sTrans;
}
struct WearableEntry : public LLDictionaryEntry
{
@ -40,7 +52,7 @@ struct WearableEntry : public LLDictionaryEntry
LLDictionaryEntry(name),
mAssetType(assetType),
mDefaultNewName(default_new_name),
mLabel(LLTrans::getString(name)),
mLabel(sTrans->getString(name)),
mIconName(iconName),
mDisableCameraSwitch(disable_camera_switch),
mAllowMultiwear(allow_multiwear)

View File

@ -32,6 +32,13 @@
#include "llinventorytype.h"
#include "llsingleton.h"
class LLTranslationBridge
{
public:
virtual std::string getString(const std::string &xml_desc) = 0;
};
class LLWearableType
{
public:
@ -59,6 +66,9 @@ public:
WT_NONE = -1,
};
static void initClass(LLTranslationBridge* trans); // initializes static members
static void cleanupClass(); // initializes static members
static const std::string& getTypeName(EType type);
static const std::string& getTypeDefaultNewName(EType type);
static const std::string& getTypeLabel(EType type);

View File

@ -88,6 +88,10 @@ list(APPEND llaudio_SOURCE_FILES ${llaudio_HEADER_FILES})
add_library (llaudio ${llaudio_SOURCE_FILES})
target_link_libraries(
llaudio
${LLCOMMON_LIBRARIES}
${LLMATH_LIBRARIES}
${LLMESSAGE_LIBRARIES}
${LLVFS_LIBRARIES}
${VORBISENC_LIBRARIES}
${VORBISFILE_LIBRARIES}
${VORBIS_LIBRARIES}

View File

@ -76,6 +76,15 @@ list(APPEND llcharacter_SOURCE_FILES ${llcharacter_HEADER_FILES})
add_library (llcharacter ${llcharacter_SOURCE_FILES})
target_link_libraries(
llcharacter
${LLCOMMON_LIBRARIES}
${LLMATH_LIBRARIES}
${LLMESSAGE_LIBRARIES}
${LLVFS_LIBRARIES}
${LLXML_LIBRARIES}
)
# Add tests
if (LL_TESTS)

View File

@ -7,6 +7,8 @@ include(LLCommon)
include(LLImage)
include(LLMath)
include(LLVFS)
include(LLKDU)
include(LLImageJ2COJ)
include(ZLIB)
include(LLAddBuildTest)
include(Tut)
@ -56,8 +58,16 @@ list(APPEND llimage_SOURCE_FILES ${llimage_HEADER_FILES})
add_library (llimage ${llimage_SOURCE_FILES})
# Libraries on which this library depends, needed for Linux builds
# Sort by high-level to low-level
if (USE_KDU)
target_link_libraries(llimage ${LLKDU_LIBRARIES})
else (USE_KDU)
target_link_libraries(llimage ${LLIMAGEJ2COJ_LIBRARIES})
endif (USE_KDU)
target_link_libraries(llimage
llcommon
${LLVFS_LIBRARIES}
${LLMATH_LIBRARIES}
${LLCOMMON_LIBRARIES}
${JPEG_LIBRARIES}
${PNG_LIBRARIES}
${ZLIB_LIBRARIES}

View File

@ -58,6 +58,12 @@ list(APPEND llinventory_SOURCE_FILES ${llinventory_HEADER_FILES})
add_library (llinventory ${llinventory_SOURCE_FILES})
target_link_libraries(llinventory
${LLCOMMON_LIBRARIES}
${LLMATH_LIBRARIES}
${LLMESSAGE_LIBRARIES}
${LLXML_LIBRARIES}
)
#add unit tests

View File

@ -41,7 +41,10 @@ set_source_files_properties(${llkdu_HEADER_FILES}
list(APPEND llkdu_SOURCE_FILES ${llkdu_HEADER_FILES})
if (USE_KDU)
add_library (${LLKDU_LIBRARIES} ${llkdu_SOURCE_FILES})
add_library (llkdu ${llkdu_SOURCE_FILES})
target_link_libraries(llkdu
${KDU_LIBRARY})
# Add tests
if (LL_TESTS)

View File

@ -99,6 +99,10 @@ list(APPEND llmath_SOURCE_FILES ${llmath_HEADER_FILES})
add_library (llmath ${llmath_SOURCE_FILES})
target_link_libraries(llmath
${LLCOMMON_LIBRARIES}
)
# Add tests
if (LL_TESTS)
include(LLAddBuildTest)

View File

@ -218,6 +218,9 @@ add_library (llmessage ${llmessage_SOURCE_FILES})
target_link_libraries(
llmessage
${CURL_LIBRARIES}
${LLCOMMON_LIBRARIES}
${LLVFS_LIBRARES}
${LLMATH_LIBRARIES}
${CARES_LIBRARIES}
${OPENSSL_LIBRARIES}
${CRYPTO_LIBRARIES}
@ -243,7 +246,7 @@ if (LL_TESTS)
${LLVFS_LIBRARIES}
${LLMATH_LIBRARIES}
${LLCOMMON_LIBRARIES}
${GOOGLEMOCK_LIBRARIES}
${GOOGLEMOCK_LIBRARIES}
)
LL_ADD_INTEGRATION_TEST(

View File

@ -59,6 +59,15 @@ list(APPEND llprimitive_SOURCE_FILES ${llprimitive_HEADER_FILES})
add_library (llprimitive ${llprimitive_SOURCE_FILES})
target_link_libraries(llprimitive
${LLCOMMON_LIBRARIES}
${LLMATH_LIBRARIES}
${LLMESSAGE_LIBRARIES}
${LLXML_LIBRARIES}
${LLPHYSICSEXTENSIONS_LIBRARIES}
)
#add unit tests
if (LL_TESTS)
INCLUDE(LLAddBuildTest)

View File

@ -105,6 +105,13 @@ add_library (llrender ${llrender_SOURCE_FILES})
# Libraries on which this library depends, needed for Linux builds
# Sort by high-level to low-level
target_link_libraries(llrender
llimage
${LLCOMMON_INCLUDE_DIRS}
${LLIMAGE_INCLUDE_DIRS}
${LLMATH_INCLUDE_DIRS}
${LLRENDER_INCLUDE_DIRS}
${LLVFS_INCLUDE_DIRS}
${LLXML_INCLUDE_DIRS}
${LLVFS_INCLUDE_DIRS}
${LLWINDOW_LIBRARIES}
${FREETYPE_LIBRARIES}
${OPENGL_LIBRARIES})

View File

@ -68,6 +68,7 @@ set(vfs_BOOST_LIBRARIES
)
target_link_libraries(llvfs
${LLCOMMON_LIBRARIES}
${vfs_BOOST_LIBRARIES}
)

View File

@ -64,6 +64,13 @@ set(viewer_HEADER_FILES
# Sort by high-level to low-level
if (LINUX AND VIEWER)
set(llwindow_LINK_LIBRARIES
${LLCOMMON_LIBRARIES}
${LLIMAGE_LIBRARIES}
${LLMATH_LIBRARIES}
${LLRENDER_LIBRARIES}
${LLVFS_LIBRARIES}
${LLWINDOW_LIBRARIES}
${LLXML_LIBRARIES}
${UI_LIBRARIES} # for GTK
${SDL_LIBRARY}
fontconfig # For FCInit and other FC* functions.
@ -160,7 +167,8 @@ endif (SERVER AND NOT WINDOWS AND NOT DARWIN)
if (llwindow_HEADER_FILES)
list(APPEND llwindow_SOURCE_FILES ${llwindow_HEADER_FILES})
endif (llwindow_HEADER_FILES)
list(APPEND viewer_SOURCE_FILES ${viewer_HEADER_FILES})
list(APPEND viewer_SOURCE_FILES ${viewer_HEADER_FILES})
if (VIEWER)
add_library (llwindow

View File

@ -39,9 +39,10 @@ list(APPEND llxml_SOURCE_FILES ${llxml_HEADER_FILES})
add_library (llxml ${llxml_SOURCE_FILES})
# Libraries on which this library depends, needed for Linux builds
# Sort by high-level to low-level
target_link_libraries( llxml
llvfs
llmath
target_link_libraries(llxml
${LLVFS_LIBRARIES}
${LLMATH_LIBRARIES}
${LLCOMMON_LIBRARIES}
${EXPAT_LIBRARIES}
)

View File

@ -7,6 +7,7 @@ include(OpenSSL)
include(CURL)
include(CARes)
include(LLCommon)
include(LLMessage)
include(LLVFS)
include(Linking)
@ -52,6 +53,7 @@ set_target_properties(mac-updater
)
target_link_libraries(mac-updater
${LLMESSAGE_LIBRARIES}
${LLVFS_LIBRARIES}
${OPENSSL_LIBRARIES}
${CRYPTO_LIBRARIES}

View File

@ -1824,17 +1824,6 @@ target_link_libraries(${VIEWER_BINARY_NAME}
${LLAPPEARANCE_LIBRARIES}
)
if (USE_KDU)
target_link_libraries(${VIEWER_BINARY_NAME}
${LLKDU_LIBRARIES}
${KDU_LIBRARY}
)
else (USE_KDU)
target_link_libraries(${VIEWER_BINARY_NAME}
${LLIMAGEJ2COJ_LIBRARIES}
)
endif (USE_KDU)
build_version(viewer)
set(ARTWORK_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH

View File

@ -668,6 +668,15 @@ LLAppViewer::~LLAppViewer()
removeMarkerFile();
}
class LLUITranslationBridge : public LLTranslationBridge
{
public:
virtual std::string getString(const std::string &xml_desc)
{
return LLTrans::getString(xml_desc);
}
};
bool LLAppViewer::init()
{
//
@ -679,6 +688,10 @@ bool LLAppViewer::init()
//
LLFastTimer::reset();
// initialize LLWearableType translation bridge.
// Memory will be cleaned up in ::cleanupClass()
LLWearableType::initClass(new LLUITranslationBridge());
// initialize SSE options
LLVector4a::initClass();
@ -1797,6 +1810,8 @@ bool LLAppViewer::cleanup()
llinfos << "Cleaning up Objects" << llendflush;
LLViewerObject::cleanupVOClasses();
LLAvatarAppearance::cleanupClass();
LLPostProcess::cleanupClass();
@ -2030,6 +2045,8 @@ bool LLAppViewer::cleanup()
llinfos << "Cleaning up LLProxy." << llendl;
LLProxy::cleanupClass();
LLWearableType::cleanupClass();
LLMainLoopRepeater::instance().stop();
//release all private memory pools.

View File

@ -1039,9 +1039,6 @@ void LLVOAvatar::initClass()
void LLVOAvatar::cleanupClass()
{
deleteAndClear(sAvatarXmlInfo);
sSkeletonXMLTree.cleanup();
sXMLTree.cleanup();
}
// virtual