auto_link.hpp
Go to the documentation of this file.
1 /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 
3 /*
4  Copyright (C) 2004 Ferdinando Ametrano
5 
6  This file is part of QuantLib, a free-software/open-source library
7  for financial quantitative analysts and developers - http://quantlib.org/
8 
9  QuantLib is free software: you can redistribute it and/or modify it
10  under the terms of the QuantLib license. You should have received a
11  copy of the license along with this program; if not, please email
12  <quantlib-dev@lists.sf.net>. The license is also available online at
13  <http://quantlib.org/license.shtml>.
14 
15  This program is distributed in the hope that it will be useful, but WITHOUT
16  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17  FOR A PARTICULAR PURPOSE. See the license for more details.
18 */
19 
20 #ifndef qla_autolink_hpp
21 #define qla_autolink_hpp
22 
23 #include <qlo/qladdindefines.hpp>
24 
25 // select toolset:
26 #if (_MSC_VER >= 1924)
27 # define QLADDIN_LIB_TOOLSET "v142"
28 #elif (_MSC_VER >= 1910)
29 # define QLADDIN_LIB_TOOLSET "v141"
30 #elif (_MSC_VER >= 1900)
31 # define QLADDIN_LIB_TOOLSET "v140"
32 #elif (_MSC_VER >= 1800)
33 # define QLADDIN_LIB_TOOLSET "v120"
34 #elif (_MSC_VER >= 1700)
35 # define QLADDIN_LIB_TOOLSET "v110"
36 #elif (_MSC_VER >= 1600)
37 # define QLADDIN_LIB_TOOLSET "v100"
38 #elif (_MSC_VER >= 1500)
39 # define QLADDIN_LIB_TOOLSET "v90"
40 #else
41 # error "unsupported Microsoft compiler"
42 #endif
43 
44 /*** libraries to be linked ***/
45 
46 // select architecture:
47 #ifdef _M_X64
48 # define QLADDIN_LIB_PLATFORM "-x64"
49 #else
50 # define QLADDIN_LIB_PLATFORM
51 #endif
52 
53 // select thread opt:
54 #ifdef _MT
55 # define QLADDIN_LIB_THREAD_OPT "-mt"
56 #else
57 # define QLADDIN_LIB_THREAD_OPT
58 #endif
59 
60 // select linkage opt:
61 #ifdef _DLL
62 # if defined(_DEBUG)
63 # define QLADDIN_LIB_RT_OPT "-gd"
64 # else
65 # define QLADDIN_LIB_RT_OPT
66 # endif
67 #else
68 # if defined(_DEBUG)
69 # define QLADDIN_LIB_RT_OPT "-sgd"
70 # else
71 # define QLADDIN_LIB_RT_OPT "-s"
72 # endif
73 #endif
74 
75 #define QLADDIN_LIB_NAME "QuantLibObjects-" QLADDIN_LIB_TOOLSET QLADDIN_LIB_PLATFORM QLADDIN_LIB_THREAD_OPT QLADDIN_LIB_RT_OPT "-" QLADDIN_LIB_VERSION ".lib"
76 
77 #pragma comment(lib, QLADDIN_LIB_NAME)
78 #ifdef BOOST_LIB_DIAGNOSTIC
79 # pragma message("Will (need to) link to lib file: " QLADDIN_LIB_NAME)
80 #endif
81 
82 #endif
83