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