| Fast DDS Version 3.3.0 Fast DDS

Loading...
Searching...
No Matches
fastdds_auto_link.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
15/*
16 Expected defines.
17
18 - EPROSIMA_LIB_NAME
19 - FASTDDS_VERSION_MAJOR
20 - FASTDDS_VERSION_MINOR
21 */
22
23#if defined(_MSC_VER)
24 #define EPROSIMA_STRINGIZE(X) EPROSIMA_DO_STRINGIZE(X)
25 #define EPROSIMA_DO_STRINGIZE(X) #X
26
27 #if defined(_DEBUG)
28 #define EPROSIMA_LIB_DEBUG_TAG "d"
29 #else
30 #define EPROSIMA_LIB_DEBUG_TAG
31 #endif // _DEBUG
32
33// Select linkage option.
34 #if (defined(_DLL) || defined(_RTLDLL)) && defined(EPROSIMA_DYN_LINK)
35 #define EPROSIMA_LIB_PREFIX
36 #elif defined(EPROSIMA_DYN_LINK)
37 #error "Mixing a dll eprosima library with a static runtime is a bad idea"
38 #else
39 #define EPROSIMA_LIB_PREFIX "lib"
40 #endif // if (defined(_DLL) || defined(_RTLDLL)) && defined(EPROSIMA_DYN_LINK)
41
42// Include library
43 #if defined(EPROSIMA_LIB_NAME) \
44 && defined(EPROSIMA_LIB_PREFIX) \
45 && defined(EPROSIMA_LIB_DEBUG_TAG) \
46 && defined(FASTDDS_VERSION_MAJOR) \
47 && defined(FASTDDS_VERSION_MINOR)
48 #pragma \
49 comment(lib, EPROSIMA_LIB_PREFIX EPROSIMA_STRINGIZE(EPROSIMA_LIB_NAME) EPROSIMA_LIB_DEBUG_TAG "-" EPROSIMA_STRINGIZE(FASTDDS_VERSION_MAJOR) "." EPROSIMA_STRINGIZE(FASTDDS_VERSION_MINOR) ".lib")
50 #else
51 #error "Some required macros where not defined"
52 #endif // if defined(EPROSIMA_LIB_NAME) && defined(EPROSIMA_LIB_PREFIX) && defined(EPROSIMA_LIB_DEBUG_TAG) && defined(FASTDDS_VERSION_MAJOR) && defined(FASTDDS_VERSION_MINOR)
53
54#endif // _MSC_VER
55
56// Undef macros
57#ifdef EPROSIMA_LIB_PREFIX
58#undef EPROSIMA_LIB_PREFIX
59#endif // ifdef EPROSIMA_LIB_PREFIX
60
61#ifdef EPROSIMA_LIB_NAME
62#undef EPROSIMA_LIB_NAME
63#endif // ifdef EPROSIMA_LIB_NAME
64
65#ifdef EPROSIMA_LIB_DEBUG_TAG
66#undef EPROSIMA_LIB_DEBUG_TAG
67#endif // ifdef EPROSIMA_LIB_DEBUG_TAG