summaryrefslogtreecommitdiff
path: root/modules/dynamic_link/macros/windows/dlwFindMsVcCompiler.sci
blob: 48b73a53a75b7acbadb29ab51d804444220c3d15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) DIGITEO - 2010 - Allan CORNET
// Copyright (C) Scilab Enterprises - 2014 - Antoine ELIAS
//
// This file must be used under the terms of the CeCILL.
// This source file is licensed as described in the file COPYING, which
// you should have received as part of this distribution.  The terms
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt

//=============================================================================
function MSCompiler = dlwFindMsVcCompiler()
    MSCompiler = "unknown"; // unknown

    // We use always last version of MS compiler

    val = getenv("SCILAB_PREFERED_MSVC", "");
    if val <> "" then
        funcs = list(dlwIsVc12Express,dlwIsVc12Pro,dlwIsVc11Express,dlwIsVc11Pro,dlwIsVc10Express,dlwIsVc10Pro);
        compilers = ["msvc120express";
        "msvc120pro";
        "msvc110express";
        "msvc110pro";
        "msvc100express";
        "msvc100pro";];
        idx = find(val == compilers);
        if idx <> [] then
            func = funcs(idx);
            if func() then
                MSCompiler = val;
                return;
            end
        end
    end

    if dlwIsVc12Express() then
        MSCompiler = "msvc120express";     // Microsoft Visual 2013 Express
        return;
    end

    if dlwIsVc12Pro() then
        MSCompiler = "msvc120pro";       // Microsoft Visual 2013 Professional (or more)
        return;
    end

    if dlwIsVc11Express() then
        MSCompiler = "msvc110express";     // Microsoft Visual 2012 Express
        return;
    end

    if dlwIsVc11Pro() then
        MSCompiler = "msvc110pro";       // Microsoft Visual 2012 Professional (or more)
        return;
    end

    if dlwIsVc10Pro() & dlwIsVc10Express() then
        MSCompiler = "msvc100express";     // Microsoft Visual 2010 Express with SDK extension
        return;
    end

    if dlwIsVc10Express() then
        MSCompiler = "msvc100express";     // Microsoft Visual 2010 Express
        return;
    end

    if dlwIsVc10Pro() then
        MSCompiler = "msvc100pro";       // Microsoft Visual 2010 Professional (or more)
        return;
    end

    if dlwIsVc90Pro() then
        MSCompiler = "msvc90pro";      // Microsoft Visual 2008 Studio Professional
        return;
    end

    if dlwIsVc90Std() then
        MSCompiler = "msvc90std";      // Microsoft Visual 2008 Studio Standard
        return;
    end

    if dlwIsVc90Express() then
        MSCompiler = "msvc90express";    // Microsoft Visual 2008 Express
        return;
    end

    if dlwIsVc80Pro() then
        MSCompiler = "msvc80pro";      // Microsoft Visual 2005 Studio Professional
        return;
    end

    if dlwIsVc80Std() then
        MSCompiler = "msvc80std";      // Microsoft Visual 2005 Studio Standard
        return;
    end

    if dlwIsVc80Express() then
        MSCompiler = "msvc80express";    // Microsoft Visual 2005 Express
        return;
    end

    if dlwIsVc71() then
        MSCompiler = "msvc71";         // Microsoft Visual Studio .NET 2003
        return;
    end

    if dlwIsVc70() then
        MSCompiler = "msvc70";         // Microsoft Visual Studio .NET 2002
        return;
    end
endfunction
//=============================================================================