[2579] | 1 | # |
---|
[2626] | 2 | # ORXONOX - the hottest 3D action shooter ever to exist |
---|
| 3 | # > www.orxonox.net < |
---|
[2579] | 4 | # |
---|
[2626] | 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. |
---|
[2579] | 9 | # |
---|
[2626] | 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. |
---|
[2579] | 14 | # |
---|
[2626] | 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. |
---|
[2579] | 18 | # |
---|
| 19 | # |
---|
[2626] | 20 | # Author: |
---|
| 21 | # Reto Grieder |
---|
| 22 | # Description: |
---|
| 23 | # Sets the right compiler and linker flags for the Microsoft Compiler. |
---|
[2579] | 24 | # |
---|
| 25 | |
---|
[2621] | 26 | #################### Compiler Flags ##################### |
---|
[2582] | 27 | |
---|
[2621] | 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 |
---|
[2582] | 36 | |
---|
[2621] | 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) |
---|
[2582] | 45 | |
---|
[2621] | 46 | # Increase warning level if requested |
---|
| 47 | IF(EXTRA_WARNINGS) |
---|
| 48 | REMOVE_COMPILER_FLAGS("-W1 -W2 -W3" CACHE) |
---|
| 49 | ADD_COMPILER_FLAGS ("-W4" CACHE) |
---|
[2624] | 50 | ELSE() |
---|
[2621] | 51 | REMOVE_COMPILER_FLAGS("-W1 -W2 -W4" CACHE) |
---|
| 52 | ADD_COMPILER_FLAGS ("-W3" CACHE) |
---|
[2624] | 53 | ENDIF() |
---|
[2583] | 54 | |
---|
[2621] | 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) |
---|
[2588] | 60 | |
---|
[2626] | 61 | |
---|
[2621] | 62 | ##################### Linker Flags ###################### |
---|
[2588] | 63 | |
---|
[2621] | 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) |
---|