Fast DDS  Version 3.0.0
Fast DDS
Loading...
Searching...
No Matches
fastdds_dll.hpp
1// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
20#ifndef FASTDDS_FASTDDS_DLL_H
21#define FASTDDS_FASTDDS_DLL_H
22
23#include <fastdds/config.hpp>
24
25// normalize macros
26#if !defined(FASTDDS_DYN_LINK) && !defined(FASTDDS_STATIC_LINK) \
27 && !defined(EPROSIMA_ALL_DYN_LINK) && !defined(EPROSIMA_ALL_STATIC_LINK)
28#define FASTDDS_STATIC_LINK
29#endif // if !defined(FASTDDS_DYN_LINK) && !defined(FASTDDS_STATIC_LINK) && !defined(EPROSIMA_ALL_DYN_LINK) && !defined(EPROSIMA_ALL_STATIC_LINK)
30
31#if defined(EPROSIMA_ALL_DYN_LINK) && !defined(FASTDDS_DYN_LINK)
32#define FASTDDS_DYN_LINK
33#endif // if defined(EPROSIMA_ALL_DYN_LINK) && !defined(FASTDDS_DYN_LINK)
34
35#if defined(FASTDDS_DYN_LINK) && defined(FASTDDS_STATIC_LINK)
36#error Must not define both FASTDDS_DYN_LINK and FASTDDS_STATIC_LINK
37#endif // if defined(FASTDDS_DYN_LINK) && defined(FASTDDS_STATIC_LINK)
38
39#if defined(EPROSIMA_ALL_NO_LIB) && !defined(FASTDDS_NO_LIB)
40#define FASTDDS_NO_LIB
41#endif // if defined(EPROSIMA_ALL_NO_LIB) && !defined(FASTDDS_NO_LIB)
42
43// enable dynamic linking
44
45#if defined(_WIN32)
46#if defined(EPROSIMA_ALL_DYN_LINK) || defined(FASTDDS_DYN_LINK)
47#if defined(fastdds_EXPORTS)
48#define FASTDDS_EXPORTED_API __declspec( dllexport )
49#else
50#define FASTDDS_EXPORTED_API __declspec( dllimport )
51#endif // FASTDDS_SOURCE
52#else
53#define FASTDDS_EXPORTED_API
54#endif // if defined(EPROSIMA_ALL_DYN_LINK) || defined(FASTDDS_DYN_LINK)
55#else
56#define FASTDDS_EXPORTED_API
57#endif // _WIN32
58
59// Auto linking.
60
61#if !defined(FASTDDS_SOURCE) && !defined(EPROSIMA_ALL_NO_LIB) \
62 && !defined(FASTDDS_NO_LIB)
63
64// Set properties.
65#define EPROSIMA_LIB_NAME fastdds
66
67#if defined(EPROSIMA_ALL_DYN_LINK) || defined(FASTDDS_DYN_LINK)
68#define EPROSIMA_DYN_LINK
69#endif // if defined(EPROSIMA_ALL_DYN_LINK) || defined(FASTDDS_DYN_LINK)
70
71#include <fastdds/fastdds_auto_link.hpp>
72#endif // auto-linking disabled
73
74#endif // FASTDDS_FASTDDS_DLL_H