From 86655c2c887692c2681342a46857e8ce0e49c165 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 13 May 2019 06:04:39 +0800 Subject: [PATCH] Support for building nlpacs as a dll --- code/nel/include/nel/misc/types_nl.h | 6 ++++++ code/nel/include/nel/pacs/build_indoor.h | 2 +- code/nel/include/nel/pacs/chain.h | 6 +++--- code/nel/include/nel/pacs/chain_quad.h | 2 +- code/nel/include/nel/pacs/collision_ot.h | 6 +++--- code/nel/include/nel/pacs/collision_surface_temp.h | 2 +- code/nel/include/nel/pacs/edge_collide.h | 2 +- code/nel/include/nel/pacs/edge_quad.h | 2 +- code/nel/include/nel/pacs/exterior_mesh.h | 2 +- code/nel/include/nel/pacs/global_retriever.h | 2 +- code/nel/include/nel/pacs/local_retriever.h | 2 +- code/nel/include/nel/pacs/move_cell.h | 2 +- code/nel/include/nel/pacs/move_container.h | 2 +- code/nel/include/nel/pacs/move_primitive.h | 2 +- code/nel/include/nel/pacs/primitive_block.h | 4 ++-- code/nel/include/nel/pacs/primitive_world_image.h | 2 +- code/nel/include/nel/pacs/retrievable_surface.h | 4 ++-- code/nel/include/nel/pacs/retriever_bank.h | 2 +- code/nel/include/nel/pacs/retriever_instance.h | 2 +- code/nel/include/nel/pacs/surface_quad.h | 4 ++-- code/nel/include/nel/pacs/u_collision_desc.h | 4 ++-- code/nel/include/nel/pacs/u_global_position.h | 4 ++-- code/nel/include/nel/pacs/u_global_retriever.h | 2 +- code/nel/include/nel/pacs/u_move_container.h | 2 +- code/nel/include/nel/pacs/u_move_primitive.h | 2 +- code/nel/include/nel/pacs/u_primitive_block.h | 2 +- code/nel/include/nel/pacs/u_retriever_bank.h | 2 +- code/nel/include/nel/pacs/vector_2s.h | 2 +- code/nel/src/georges/CMakeLists.txt | 2 +- code/nel/src/ligo/CMakeLists.txt | 2 ++ code/nel/src/pacs/CMakeLists.txt | 8 +++++++- code/nel/src/sound/driver/CMakeLists.txt | 2 ++ 32 files changed, 54 insertions(+), 38 deletions(-) diff --git a/code/nel/include/nel/misc/types_nl.h b/code/nel/include/nel/misc/types_nl.h index be771c94c..99d1999f7 100644 --- a/code/nel/include/nel/misc/types_nl.h +++ b/code/nel/include/nel/misc/types_nl.h @@ -566,11 +566,17 @@ typedef uint16 ucchar; #else #define NLLIGO_API NL_DECL_DLLIMP #endif +#ifdef NLPACS_DLLEXP +#define NLPACS_API NL_DECL_DLLEXP +#else +#define NLPACS_API NL_DECL_DLLIMP +#endif #else #define NLMISC_API #define NLSOUND_LOWLEVEL_API #define NLGEORGES_API #define NLLIGO_API +#define NLPACS_API #endif // To define a 64bits constant; ie: UINT64_CONSTANT(0x123456781234) diff --git a/code/nel/include/nel/pacs/build_indoor.h b/code/nel/include/nel/pacs/build_indoor.h index 6e303fdd7..9bc15742d 100644 --- a/code/nel/include/nel/pacs/build_indoor.h +++ b/code/nel/include/nel/pacs/build_indoor.h @@ -32,7 +32,7 @@ class CLocalRetriever; /// Computation functions, returns false if false -bool computeRetriever(CCollisionMeshBuild &cmb, +NLPACS_API bool computeRetriever(CCollisionMeshBuild &cmb, CLocalRetriever &lr, NLMISC::CVector &translation, std::string &error, diff --git a/code/nel/include/nel/pacs/chain.h b/code/nel/include/nel/pacs/chain.h index 35b2f65fd..9c796c94e 100644 --- a/code/nel/include/nel/pacs/chain.h +++ b/code/nel/include/nel/pacs/chain.h @@ -36,7 +36,7 @@ class COrderedChain; * \author Nevrax France * \date 2001 */ -class COrderedChain3f +class NLPACS_API COrderedChain3f { protected: friend class CChain; @@ -95,7 +95,7 @@ public: * \author Nevrax France * \date 2001 */ -class COrderedChain +class NLPACS_API COrderedChain { protected: friend class CChain; @@ -198,7 +198,7 @@ public: * \author Nevrax France * \date 2001 */ -class CChain +class NLPACS_API CChain { protected: friend class CRetrievableSurface; diff --git a/code/nel/include/nel/pacs/chain_quad.h b/code/nel/include/nel/pacs/chain_quad.h index 0a9df779e..157fef8e9 100644 --- a/code/nel/include/nel/pacs/chain_quad.h +++ b/code/nel/include/nel/pacs/chain_quad.h @@ -48,7 +48,7 @@ struct EChainQuad : public NLMISC::Exception * \author Nevrax France * \date 2001 */ -class CChainQuad +class NLPACS_API CChainQuad { public: diff --git a/code/nel/include/nel/pacs/collision_ot.h b/code/nel/include/nel/pacs/collision_ot.h index 9bf92bed2..a5fded65c 100644 --- a/code/nel/include/nel/pacs/collision_ot.h +++ b/code/nel/include/nel/pacs/collision_ot.h @@ -96,7 +96,7 @@ public: } /// Get next element in the ot - CCollisionOTInfo *getNextInfo () const; + NLPACS_API CCollisionOTInfo *getNextInfo () const; private: // The next cell @@ -292,7 +292,7 @@ public: } // Remove the collision from the primitives - void removeFromPrimitives (); + NLPACS_API void removeFromPrimitives (); // Get second primitive CMovePrimitive *getOtherPrimitive (CMovePrimitive *primitive) const @@ -418,7 +418,7 @@ public: } // Remove the collision from the primitives - void removeFromPrimitives (); + NLPACS_API void removeFromPrimitives (); CMovePrimitive *getOtherPrimitive (CMovePrimitive * /* primitive */) const { diff --git a/code/nel/include/nel/pacs/collision_surface_temp.h b/code/nel/include/nel/pacs/collision_surface_temp.h index 95b68842a..0298945b8 100644 --- a/code/nel/include/nel/pacs/collision_surface_temp.h +++ b/code/nel/include/nel/pacs/collision_surface_temp.h @@ -239,7 +239,7 @@ public: * \author Nevrax France * \date 2001 */ -class CCollisionSurfaceTemp +class NLPACS_API CCollisionSurfaceTemp { public: typedef std::pair TExteriorEdgeIndex; diff --git a/code/nel/include/nel/pacs/edge_collide.h b/code/nel/include/nel/pacs/edge_collide.h index 3c46afb78..1c27ac7b3 100644 --- a/code/nel/include/nel/pacs/edge_collide.h +++ b/code/nel/include/nel/pacs/edge_collide.h @@ -168,7 +168,7 @@ public: * \author Nevrax France * \date 2001 */ -class CEdgeCollide +class NLPACS_API CEdgeCollide { public: enum TPointMoveProblem {ParallelEdges=0, StartOnEdge, StopOnEdge, TraverseEndPoint, EdgeNull, PointMoveProblemCount}; diff --git a/code/nel/include/nel/pacs/edge_quad.h b/code/nel/include/nel/pacs/edge_quad.h index 71785cb13..83431f02d 100644 --- a/code/nel/include/nel/pacs/edge_quad.h +++ b/code/nel/include/nel/pacs/edge_quad.h @@ -53,7 +53,7 @@ struct EEdgeQuad : public NLMISC::Exception * \author Nevrax France * \date 2001 */ -class CEdgeQuad +class NLPACS_API CEdgeQuad { public: diff --git a/code/nel/include/nel/pacs/exterior_mesh.h b/code/nel/include/nel/pacs/exterior_mesh.h index 272248c71..0c2401d80 100644 --- a/code/nel/include/nel/pacs/exterior_mesh.h +++ b/code/nel/include/nel/pacs/exterior_mesh.h @@ -44,7 +44,7 @@ namespace NLPACS * \author Nevrax France * \date 2001 */ -class CExteriorMesh +class NLPACS_API CExteriorMesh { public: /// An edge of the edge list diff --git a/code/nel/include/nel/pacs/global_retriever.h b/code/nel/include/nel/pacs/global_retriever.h index 9634af692..701e2e217 100644 --- a/code/nel/include/nel/pacs/global_retriever.h +++ b/code/nel/include/nel/pacs/global_retriever.h @@ -52,7 +52,7 @@ namespace NLPACS * \author Nevrax France * \date 2001 */ -class CGlobalRetriever : public UGlobalRetriever +class NLPACS_API CGlobalRetriever : public UGlobalRetriever { public: diff --git a/code/nel/include/nel/pacs/local_retriever.h b/code/nel/include/nel/pacs/local_retriever.h index d76aa0891..4727d54b2 100644 --- a/code/nel/include/nel/pacs/local_retriever.h +++ b/code/nel/include/nel/pacs/local_retriever.h @@ -51,7 +51,7 @@ class CCollisionSurfaceTemp; * \author Nevrax France * \date 2001 */ -class CLocalRetriever +class NLPACS_API CLocalRetriever { public: /** diff --git a/code/nel/include/nel/pacs/move_cell.h b/code/nel/include/nel/pacs/move_cell.h index 18a8a7307..871a6dbcc 100644 --- a/code/nel/include/nel/pacs/move_cell.h +++ b/code/nel/include/nel/pacs/move_cell.h @@ -32,7 +32,7 @@ class CMoveElement; * \author Nevrax France * \date 2001 */ -class CMoveCell +class NLPACS_API CMoveCell { public: diff --git a/code/nel/include/nel/pacs/move_container.h b/code/nel/include/nel/pacs/move_container.h index 5193e8386..da5da1d9a 100644 --- a/code/nel/include/nel/pacs/move_container.h +++ b/code/nel/include/nel/pacs/move_container.h @@ -44,7 +44,7 @@ class CPrimitiveWorldImage; * \date 2001 */ -class CMoveContainer: public UMoveContainer +class NLPACS_API CMoveContainer: public UMoveContainer { friend class CMovePrimitive; friend class CPrimitiveWorldImage; diff --git a/code/nel/include/nel/pacs/move_primitive.h b/code/nel/include/nel/pacs/move_primitive.h index aa153c076..4bad7d408 100644 --- a/code/nel/include/nel/pacs/move_primitive.h +++ b/code/nel/include/nel/pacs/move_primitive.h @@ -40,7 +40,7 @@ namespace NLPACS * \author Nevrax France * \date 2001 */ -class CMovePrimitive: public UMovePrimitive +class NLPACS_API CMovePrimitive: public UMovePrimitive { private: friend class CMoveContainer; diff --git a/code/nel/include/nel/pacs/primitive_block.h b/code/nel/include/nel/pacs/primitive_block.h index ee784ed02..fceede51f 100644 --- a/code/nel/include/nel/pacs/primitive_block.h +++ b/code/nel/include/nel/pacs/primitive_block.h @@ -31,7 +31,7 @@ namespace NLPACS * \author Nevrax France * \date 2002 */ -class CPrimitiveDesc +class NLPACS_API CPrimitiveDesc { public: @@ -85,7 +85,7 @@ public: * \author Nevrax France * \date 2002 */ -class CPrimitiveBlock : public UPrimitiveBlock +class NLPACS_API CPrimitiveBlock : public UPrimitiveBlock { public: diff --git a/code/nel/include/nel/pacs/primitive_world_image.h b/code/nel/include/nel/pacs/primitive_world_image.h index 1707318eb..8354919ce 100644 --- a/code/nel/include/nel/pacs/primitive_world_image.h +++ b/code/nel/include/nel/pacs/primitive_world_image.h @@ -31,7 +31,7 @@ namespace NLPACS { * \author Nevrax France * \date 2001 */ -class CPrimitiveWorldImage +class NLPACS_API CPrimitiveWorldImage { public: diff --git a/code/nel/include/nel/pacs/retrievable_surface.h b/code/nel/include/nel/pacs/retrievable_surface.h index f1072d3dd..1c4243b7b 100644 --- a/code/nel/include/nel/pacs/retrievable_surface.h +++ b/code/nel/include/nel/pacs/retrievable_surface.h @@ -45,7 +45,7 @@ enum /** * The features of the models, as floats */ -extern float Models[NumMaxCreatureModels][NumModelCharacteristics]; +NLPACS_API extern float Models[NumMaxCreatureModels][NumModelCharacteristics]; @@ -56,7 +56,7 @@ extern float Models[NumMaxCreatureModels][NumModelCharacteristics]; * \author Nevrax France * \date 2001 */ -class CRetrievableSurface +class NLPACS_API CRetrievableSurface { public: /** diff --git a/code/nel/include/nel/pacs/retriever_bank.h b/code/nel/include/nel/pacs/retriever_bank.h index eb7afb31b..a028a5d30 100644 --- a/code/nel/include/nel/pacs/retriever_bank.h +++ b/code/nel/include/nel/pacs/retriever_bank.h @@ -39,7 +39,7 @@ namespace NLPACS * \author Nevrax France * \date 2001 */ -class CRetrieverBank : public URetrieverBank +class NLPACS_API CRetrieverBank : public URetrieverBank { friend class URetrieverBank; diff --git a/code/nel/include/nel/pacs/retriever_instance.h b/code/nel/include/nel/pacs/retriever_instance.h index f58883d80..89a8003ce 100644 --- a/code/nel/include/nel/pacs/retriever_instance.h +++ b/code/nel/include/nel/pacs/retriever_instance.h @@ -44,7 +44,7 @@ const float SnapPrecision= 1024; * \author Nevrax France * \date 2001 */ -class CRetrieverInstance +class NLPACS_API CRetrieverInstance { public: /** diff --git a/code/nel/include/nel/pacs/surface_quad.h b/code/nel/include/nel/pacs/surface_quad.h index 676861851..2308eebb3 100644 --- a/code/nel/include/nel/pacs/surface_quad.h +++ b/code/nel/include/nel/pacs/surface_quad.h @@ -93,7 +93,7 @@ public: }; // -class CQuadBranch : public IQuadNode +class NLPACS_API CQuadBranch : public IQuadNode { public: enum @@ -142,7 +142,7 @@ public: void serial(NLMISC::IStream &f); }; -class CSurfaceQuadTree +class NLPACS_API CSurfaceQuadTree { protected: diff --git a/code/nel/include/nel/pacs/u_collision_desc.h b/code/nel/include/nel/pacs/u_collision_desc.h index 965ca7ddf..ec3856181 100644 --- a/code/nel/include/nel/pacs/u_collision_desc.h +++ b/code/nel/include/nel/pacs/u_collision_desc.h @@ -39,7 +39,7 @@ namespace NLPACS * \author Nevrax France * \date 2001 */ -class UCollisionDesc +class NLPACS_API UCollisionDesc { public: NLMISC::CVectorD ContactPosition; @@ -58,7 +58,7 @@ public: * \author Nevrax France * \date 2001 */ -class UTriggerInfo +class NLPACS_API UTriggerInfo { public: enum diff --git a/code/nel/include/nel/pacs/u_global_position.h b/code/nel/include/nel/pacs/u_global_position.h index 199fd6a2d..149b8542c 100644 --- a/code/nel/include/nel/pacs/u_global_position.h +++ b/code/nel/include/nel/pacs/u_global_position.h @@ -32,7 +32,7 @@ namespace NLPACS * \author Nevrax France * \date 2001 */ -class ULocalPosition +class NLPACS_API ULocalPosition { public: /// The id of the surface corresponding to the local position. @@ -59,7 +59,7 @@ public: * \author Nevrax France * \date 2001 */ -class UGlobalPosition +class NLPACS_API UGlobalPosition { public: diff --git a/code/nel/include/nel/pacs/u_global_retriever.h b/code/nel/include/nel/pacs/u_global_retriever.h index 673d3d4f6..47aa34f88 100644 --- a/code/nel/include/nel/pacs/u_global_retriever.h +++ b/code/nel/include/nel/pacs/u_global_retriever.h @@ -42,7 +42,7 @@ class UGlobalPosition; * \author Nevrax France * \date 2001 */ -class UGlobalRetriever +class NLPACS_API UGlobalRetriever { public: virtual ~UGlobalRetriever() {} diff --git a/code/nel/include/nel/pacs/u_move_container.h b/code/nel/include/nel/pacs/u_move_container.h index 9437d2fae..159690e69 100644 --- a/code/nel/include/nel/pacs/u_move_container.h +++ b/code/nel/include/nel/pacs/u_move_container.h @@ -48,7 +48,7 @@ class UPrimitiveBlock; * \author Nevrax France * \date 2001 */ -class UMoveContainer +class NLPACS_API UMoveContainer { public: diff --git a/code/nel/include/nel/pacs/u_move_primitive.h b/code/nel/include/nel/pacs/u_move_primitive.h index 5a021daa8..9da2340bc 100644 --- a/code/nel/include/nel/pacs/u_move_primitive.h +++ b/code/nel/include/nel/pacs/u_move_primitive.h @@ -40,7 +40,7 @@ class UGlobalPosition; * \author Nevrax France * \date 2001 */ -class UMovePrimitive +class NLPACS_API UMovePrimitive { public: diff --git a/code/nel/include/nel/pacs/u_primitive_block.h b/code/nel/include/nel/pacs/u_primitive_block.h index 20c6065b7..c2b9671d4 100644 --- a/code/nel/include/nel/pacs/u_primitive_block.h +++ b/code/nel/include/nel/pacs/u_primitive_block.h @@ -36,7 +36,7 @@ namespace NLPACS * \author Nevrax France * \date 2002 */ -class UPrimitiveBlock +class NLPACS_API UPrimitiveBlock { public: // dtor diff --git a/code/nel/include/nel/pacs/u_retriever_bank.h b/code/nel/include/nel/pacs/u_retriever_bank.h index ec91a04a0..14b5b4b96 100644 --- a/code/nel/include/nel/pacs/u_retriever_bank.h +++ b/code/nel/include/nel/pacs/u_retriever_bank.h @@ -33,7 +33,7 @@ namespace NLPACS { * \author Nevrax France * \date 2001 */ -class URetrieverBank +class NLPACS_API URetrieverBank { public: diff --git a/code/nel/include/nel/pacs/vector_2s.h b/code/nel/include/nel/pacs/vector_2s.h index e6a932c5f..fc7e9e431 100644 --- a/code/nel/include/nel/pacs/vector_2s.h +++ b/code/nel/include/nel/pacs/vector_2s.h @@ -34,7 +34,7 @@ const float Vector2sAccuracy = 128.0f; * \author Nevrax France * \date 2001 */ -class CVector2s +class NLPACS_API CVector2s { private: // safely cast a fixed64 into a fixed16 diff --git a/code/nel/src/georges/CMakeLists.txt b/code/nel/src/georges/CMakeLists.txt index 9468d7577..61fafc9d8 100644 --- a/code/nel/src/georges/CMakeLists.txt +++ b/code/nel/src/georges/CMakeLists.txt @@ -1,7 +1,7 @@ FILE(GLOB SRC *.cpp *.h) FILE(GLOB HEADERS ../../include/nel/georges/*.h) -# SOURCE_GROUP(headers FILES ${HEADERS}) +SOURCE_GROUP("" FILES ${HEADERS} ${SRC}) NL_TARGET_LIB2(nelgeorges ${HEADERS} ${SRC}) diff --git a/code/nel/src/ligo/CMakeLists.txt b/code/nel/src/ligo/CMakeLists.txt index 1faffd3bc..4f8811e77 100644 --- a/code/nel/src/ligo/CMakeLists.txt +++ b/code/nel/src/ligo/CMakeLists.txt @@ -1,6 +1,8 @@ FILE(GLOB SRC *.cpp *.h) FILE(GLOB HEADERS ../../include/nel/ligo/*.h) +SOURCE_GROUP("" FILES ${HEADERS} ${SRC}) + NL_TARGET_LIB2(nelligo ${HEADERS} ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) diff --git a/code/nel/src/pacs/CMakeLists.txt b/code/nel/src/pacs/CMakeLists.txt index 70a80500a..6053119a4 100644 --- a/code/nel/src/pacs/CMakeLists.txt +++ b/code/nel/src/pacs/CMakeLists.txt @@ -1,7 +1,9 @@ FILE(GLOB SRC *.cpp *.h) FILE(GLOB HEADERS ../../include/nel/pacs/*.h) -NL_TARGET_LIB(nelpacs ${HEADERS} ${SRC}) +SOURCE_GROUP("" FILES ${HEADERS} ${SRC}) + +NL_TARGET_LIB2(nelpacs ${HEADERS} ${SRC}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) @@ -11,6 +13,10 @@ NL_ADD_RUNTIME_FLAGS(nelpacs) NL_ADD_LIB_SUFFIX(nelpacs) +IF(WIN32 AND NOT WITH_STATIC2) + ADD_DEFINITIONS(-DNLPACS_DLLEXP) +ENDIF() + ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) IF(WITH_PCH) diff --git a/code/nel/src/sound/driver/CMakeLists.txt b/code/nel/src/sound/driver/CMakeLists.txt index 814bc19ce..0d2a995e9 100644 --- a/code/nel/src/sound/driver/CMakeLists.txt +++ b/code/nel/src/sound/driver/CMakeLists.txt @@ -1,6 +1,8 @@ FILE(GLOB SRC *.cpp *.h) FILE(GLOB HEADERS ../../../include/nel/sound/driver/*.h) +SOURCE_GROUP("" FILES ${HEADERS} ${SRC}) + NL_TARGET_LIB2(nelsnd_lowlevel ${HEADERS} ${SRC}) TARGET_LINK_LIBRARIES(nelsnd_lowlevel nelmisc)