1 | # |
---|
2 | # ORXONOX - the hottest 3D action shooter ever to exist |
---|
3 | # > www.orxonox.net < |
---|
4 | # |
---|
5 | # This program is free software; you can redistribute it and/or |
---|
6 | # modify it under the terms of the GNU General Public License |
---|
7 | # as published by the Free Software Foundation; either version 2 |
---|
8 | # of the License, or (at your option) any later version. |
---|
9 | # |
---|
10 | # This program is distributed in the hope that it will be useful, |
---|
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
13 | # GNU General Public License for more details. |
---|
14 | # |
---|
15 | # You should have received a copy of the GNU General Public License along |
---|
16 | # with this program; if not, write to the Free Software Foundation, |
---|
17 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
18 | # |
---|
19 | # |
---|
20 | # Author: |
---|
21 | # Reto Grieder |
---|
22 | # Description: |
---|
23 | # Sets the right compiler and linker flags for the Microsoft Compiler. |
---|
24 | # |
---|
25 | |
---|
26 | #################### Compiler Flags ##################### |
---|
27 | |
---|
28 | # -MD Minimal Rebuild |
---|
29 | # -RTC1 Both basic runtime checks |
---|
30 | # -MD[d] Multithreaded [debug] DLL |
---|
31 | # -Zi Program Database |
---|
32 | # -ZI Program Database for Edit & Continue |
---|
33 | # -WX General warning Level X |
---|
34 | # -wdX Disable specific warning X |
---|
35 | # -wnX Set warning level of specific warning X to level n |
---|
36 | |
---|
37 | # Overwrite CMake default flags first. Be careful with this |
---|
38 | # Only add (not set) the general compiler flags. |
---|
39 | # CMake default flags : -DWIN32 -D_WINDOWS -W3 -Zm1000 |
---|
40 | # additionally for CXX: -EHsc -GR |
---|
41 | ADD_COMPILER_FLAGS("-D__WIN32__ -D_WIN32" CACHE) |
---|
42 | ADD_COMPILER_FLAGS("-D_CRT_SECURE_NO_WARNINGS" CACHE) |
---|
43 | ADD_COMPILER_FLAGS("-DUNICODE -D_UNICODE" CACHE) |
---|
44 | ADD_COMPILER_FLAGS("-w44522 -w44251 -w44800" CACHE) |
---|
45 | |
---|
46 | # Increase warning level if requested |
---|
47 | IF(EXTRA_WARNINGS) |
---|
48 | REMOVE_COMPILER_FLAGS("-W1 -W2 -W3" CACHE) |
---|
49 | ADD_COMPILER_FLAGS ("-W4" CACHE) |
---|
50 | ELSE() |
---|
51 | REMOVE_COMPILER_FLAGS("-W1 -W2 -W4" CACHE) |
---|
52 | ADD_COMPILER_FLAGS ("-W3" CACHE) |
---|
53 | ENDIF() |
---|
54 | |
---|
55 | # Overwrite CMake default flags here. |
---|
56 | SET_COMPILER_FLAGS("-MDd -Od -ZI -D_DEBUG -Gm -RTC1" Debug CACHE) |
---|
57 | SET_COMPILER_FLAGS("-MD -O2 -DNDEBUG -MP2" Release CACHE) |
---|
58 | SET_COMPILER_FLAGS("-MD -O2 -Zi -DNDEBUG" RelWithDebInfo CACHE) |
---|
59 | SET_COMPILER_FLAGS("-MD -O1 -DNDEBUG -MP2" MinSizeRel CACHE) |
---|
60 | |
---|
61 | |
---|
62 | ##################### Linker Flags ###################### |
---|
63 | |
---|
64 | # CMake default flags: -MANIFEST -STACK:10000000 -machine:I386 |
---|
65 | # and INCREMENTAL and DEBUG for debug versions |
---|
66 | ADD_LINKER_FLAGS("-OPT:REF -OPT:ICF -OPT:NOWIN98" Release MinSizeRel CACHE) |
---|