Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix shared on windows #461

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 1 addition & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,7 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

if(APPLE)
cmake_minimum_required(VERSION 3.0.0)
elseif(MSVC)
cmake_minimum_required(VERSION 3.1.3)
else()
cmake_minimum_required(VERSION 2.8.12)
endif()
cmake_minimum_required(VERSION 3.7)

project(fcl CXX)

Expand Down
21 changes: 21 additions & 0 deletions include/fcl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,29 @@ set(GENERATED_FILE_MARKER "GENERATED FILE DO NOT EDIT")

configure_file(config.h.in config.h @ONLY)

set(FCL_EXPORT_MACRO_NAME "FCL_API")
if(MSVC)
set(EXPORT_INSTANTIATION_TEMPLATE_MACROS "
#ifdef ${PROJECT_NAME}_EXPORTS
/* We are building this library */
# define FCL_EXTERN_TEMPLATE_API
# define FCL_INSTANTIATION_DEF_API ${FCL_EXPORT_MACRO_NAME}
#else
/* We are using this library */
# define FCL_EXTERN_TEMPLATE_API ${FCL_EXPORT_MACRO_NAME}
# define FCL_INSTANTIATION_DEF_API
#endif
")
else()
set(EXPORT_INSTANTIATION_TEMPLATE_MACROS "
#define FCL_EXTERN_TEMPLATE_API ${FCL_EXPORT_MACRO_NAME}
#define FCL_INSTANTIATION_DEF_API
")
endif()
generate_export_header(${PROJECT_NAME}
EXPORT_MACRO_NAME ${FCL_EXPORT_MACRO_NAME}
EXPORT_FILE_NAME export.h
CUSTOM_CONTENT_FROM_VARIABLE EXPORT_INSTANTIATION_TEMPLATE_MACROS
)

get_filename_component(PARENT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}"
Expand Down
6 changes: 3 additions & 3 deletions include/fcl/broadphase/broadphase_SSaP-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
*/

/** @author Jia Pan */

Expand All @@ -45,7 +45,7 @@ namespace fcl

//==============================================================================
extern template
class FCL_EXPORT SSaPCollisionManager<double>;
class FCL_EXTERN_TEMPLATE_API SSaPCollisionManager<double>;

/** @brief Functor sorting objects according to the AABB<S> lower x bound */
template <typename S>
Expand Down Expand Up @@ -85,7 +85,7 @@ struct SortByZLow

/** @brief Dummy collision object with a point AABB<S> */
template <typename S>
class FCL_EXPORT DummyCollisionObject : public CollisionObject<S>
class DummyCollisionObject : public CollisionObject<S>
{
public:
DummyCollisionObject(const AABB<S>& aabb_) : CollisionObject<S>(std::shared_ptr<CollisionGeometry<S>>())
Expand Down
12 changes: 6 additions & 6 deletions include/fcl/broadphase/broadphase_SSaP.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
*/

/** @author Jia Pan */

Expand All @@ -44,9 +44,9 @@
namespace fcl
{

/// @brief Simple SAP collision manager
/// @brief Simple SAP collision manager
template <typename S>
class FCL_EXPORT SSaPCollisionManager : public BroadPhaseCollisionManager<S>
class SSaPCollisionManager : public BroadPhaseCollisionManager<S>
{
public:
SSaPCollisionManager();
Expand Down Expand Up @@ -89,21 +89,21 @@ class FCL_EXPORT SSaPCollisionManager : public BroadPhaseCollisionManager<S>

/// @brief whether the manager is empty
bool empty() const;

/// @brief the number of objects managed by the manager
size_t size() const;

protected:
/// @brief check collision between one object and a list of objects, return value is whether stop is possible
bool checkColl(typename std::vector<CollisionObject<S>*>::const_iterator pos_start, typename std::vector<CollisionObject<S>*>::const_iterator pos_end,
CollisionObject<S>* obj, void* cdata, CollisionCallBack<S> callback) const;

/// @brief check distance between one object and a list of objects, return value is whether stop is possible
bool checkDis(typename std::vector<CollisionObject<S>*>::const_iterator pos_start, typename std::vector<CollisionObject<S>*>::const_iterator pos_end,
CollisionObject<S>* obj, void* cdata, DistanceCallBack<S> callback, S& min_dist) const;

bool collide_(CollisionObject<S>* obj, void* cdata, CollisionCallBack<S> callback) const;

bool distance_(CollisionObject<S>* obj, void* cdata, DistanceCallBack<S> callback, S& min_dist) const;

static size_t selectOptimalAxis(
Expand Down
4 changes: 2 additions & 2 deletions include/fcl/broadphase/broadphase_SaP-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
*/

/** @author Jia Pan */

Expand All @@ -45,7 +45,7 @@ namespace fcl

//==============================================================================
extern template
class FCL_EXPORT SaPCollisionManager<double>;
class FCL_EXTERN_TEMPLATE_API SaPCollisionManager<double>;

//==============================================================================
template <typename S>
Expand Down
16 changes: 8 additions & 8 deletions include/fcl/broadphase/broadphase_SaP.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
*/

/** @author Jia Pan */

Expand All @@ -48,7 +48,7 @@ namespace fcl

/// @brief Rigorous SAP collision manager
template <typename S>
class FCL_EXPORT SaPCollisionManager : public BroadPhaseCollisionManager<S>
class SaPCollisionManager : public BroadPhaseCollisionManager<S>
{
public:

Expand Down Expand Up @@ -103,7 +103,7 @@ class FCL_EXPORT SaPCollisionManager : public BroadPhaseCollisionManager<S>

/// @brief whether the manager is empty
bool empty() const;

/// @brief the number of objects managed by the manager
size_t size() const;

Expand All @@ -119,18 +119,18 @@ class FCL_EXPORT SaPCollisionManager : public BroadPhaseCollisionManager<S>
struct SaPPair;

/// @brief Functor to help unregister one object
class FCL_EXPORT isUnregistered;
class isUnregistered;

/// @brief Functor to help remove collision pairs no longer valid (i.e., should be culled away)
class FCL_EXPORT isNotValidPair;
class isNotValidPair;

void update_(SaPAABB* updated_aabb);

void updateVelist();

/// @brief End point list for x, y, z coordinates
EndPoint* elist[3];

/// @brief vector version of elist, for acceleration
std::vector<EndPoint*> velist[3];

Expand Down Expand Up @@ -215,7 +215,7 @@ struct SaPCollisionManager<S>::SaPPair

/// @brief Functor to help unregister one object
template <typename S>
class FCL_EXPORT SaPCollisionManager<S>::isUnregistered
class SaPCollisionManager<S>::isUnregistered
{
CollisionObject<S>* obj;

Expand All @@ -227,7 +227,7 @@ class FCL_EXPORT SaPCollisionManager<S>::isUnregistered

/// @brief Functor to help remove collision pairs no longer valid (i.e., should be culled away)
template <typename S>
class FCL_EXPORT SaPCollisionManager<S>::isNotValidPair
class SaPCollisionManager<S>::isNotValidPair
{
CollisionObject<S>* obj1;
CollisionObject<S>* obj2;
Expand Down
4 changes: 2 additions & 2 deletions include/fcl/broadphase/broadphase_bruteforce-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
*/

/** @author Jia Pan */

Expand All @@ -46,7 +46,7 @@ namespace fcl {

//==============================================================================
extern template
class FCL_EXPORT NaiveCollisionManager<double>;
class FCL_EXTERN_TEMPLATE_API NaiveCollisionManager<double>;

//==============================================================================
template <typename S>
Expand Down
6 changes: 3 additions & 3 deletions include/fcl/broadphase/broadphase_bruteforce.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
*/

/** @author Jia Pan */

Expand All @@ -46,7 +46,7 @@ namespace fcl

/// @brief Brute force N-body collision manager
template <typename S>
class FCL_EXPORT NaiveCollisionManager : public BroadPhaseCollisionManager<S>
class NaiveCollisionManager : public BroadPhaseCollisionManager<S>
{
public:
NaiveCollisionManager();
Expand Down Expand Up @@ -92,7 +92,7 @@ class FCL_EXPORT NaiveCollisionManager : public BroadPhaseCollisionManager<S>

/// @brief whether the manager is empty
bool empty() const;

/// @brief the number of objects managed by the manager
size_t size() const;

Expand Down
2 changes: 1 addition & 1 deletion include/fcl/broadphase/broadphase_collision_manager-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace fcl {

//==============================================================================
extern template
class FCL_EXPORT BroadPhaseCollisionManager<double>;
class FCL_EXTERN_TEMPLATE_API BroadPhaseCollisionManager<double>;

//==============================================================================
template <typename S>
Expand Down
6 changes: 3 additions & 3 deletions include/fcl/broadphase/broadphase_collision_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
*/

/** @author Jia Pan */

Expand Down Expand Up @@ -63,7 +63,7 @@ using DistanceCallBack = bool (*)(
/// collision/distance between N objects. Also support self collision, self
/// distance and collision/distance with another M objects.
template <typename S>
class FCL_EXPORT BroadPhaseCollisionManager
class BroadPhaseCollisionManager
{
public:
BroadPhaseCollisionManager();
Expand Down Expand Up @@ -117,7 +117,7 @@ class FCL_EXPORT BroadPhaseCollisionManager

/// @brief whether the manager is empty
virtual bool empty() const = 0;

/// @brief the number of objects managed by the manager
virtual size_t size() const = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace fcl {

//==============================================================================
extern template
class FCL_EXPORT BroadPhaseContinuousCollisionManager<double>;
class FCL_EXTERN_TEMPLATE_API BroadPhaseContinuousCollisionManager<double>;

//==============================================================================
template <typename S>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
*/

/** @author Jia Pan */

Expand Down Expand Up @@ -63,7 +63,7 @@ using ContinuousDistanceCallBack = bool (*)(
/// accelerate the continuous collision/distance between N objects. Also support
/// self collision, self distance and collision/distance with another M objects.
template <typename S>
class FCL_EXPORT BroadPhaseContinuousCollisionManager
class BroadPhaseContinuousCollisionManager
{
public:
BroadPhaseContinuousCollisionManager();
Expand Down Expand Up @@ -117,7 +117,7 @@ class FCL_EXPORT BroadPhaseContinuousCollisionManager

/// @brief whether the manager is empty
virtual bool empty() const = 0;

/// @brief the number of objects managed by the manager
virtual size_t size() const = 0;
};
Expand Down
Loading