forked from gildor2/UEViewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.project
191 lines (155 loc) · 5.28 KB
/
common.project
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# perl highlighting
LIBC = shared
#MAPFILES = 1
CONSOLE = 1
!if !defined($OPTIMIZE) # allow overriding of OPTIMIZE in parent project
OPTIMIZE = size
!endif
PDB = 2 # keep enabled, executable is almost the same, except embedded link to pdb file
!if !defined($OLDCRT) # allow overriding of OLDCRT in parent project
OLDCRT = 1 # set to 0 (or comment the line) to use "native" compiler's CRT
!endif
#------------------------------------------------
# Compiler-specific options
#------------------------------------------------
STDDEFS = # common defines
WARNINGS = # warnings for our source code (i.e. excluding thirs-parties), empty by default
USE_SYSTEM_LIBS = 0
!if "$COMPILER" eq "VisualC"
!if !defined($CPP_EXCEPT)
CPP_EXCEPT = 0 # used with WIN32_USE_SEH in Core.h
!endif
WINXP = 1 # we're not using any modern Win32 features, so allow to worn at WinXP
OPTIONS = -GS- -GR-
# WARNINGS += -W4 # maximal warning level for Visual C++
WDKCRT = $R/../Libs/msvcrt
!if "$OLDCRT" eq "1" && -e "$WDKCRT/msvcrt.project"
STDDEFS += OLDCRT # used in code to distinguish which functions are available
STDDEFS += _NO_CRT_STDIO_INLINE # UCRT (VS 2015+): without that, all printf functions will use some "common" function
!include $WDKCRT/msvcrt.project
!if "$VC_VER" >= 2015 # support for OLDCRT with modern compliers
OPTIONS += -Zc:threadSafeInit- # disable calls to C++11 thread-safe static object initializers
STDDEFS += _ACRTIMP_ALT= # remove dllimport from some CRT functions (there're just a few)
!endif
!endif
LINKFLAGS += -largeaddressaware # allow 32-bit build to use more than 2Gb or RAM
!endif
!if "$COMPILER" eq "GnuC"
# linux/cygwin + GCC
STDLIBS = stdc++ m GL # libm for math.h functions
!if "$PLATFORM" ne "cygwin"
STDLIBS += dl # dlopen() and friends
!endif
LIBC = shared
OPTIONS = -msse2 # enable SSE instructions
OPTIONS += -fno-strict-aliasing # required for our uint_cast()-based FP hacks (check!! taken from my Quake2)
OPTIONS += -fno-stack-protector # this will remove GLIBC_2.4 dependency
OPTIONS += {
# enable some warnings
-Wunused-value # warning about expression which is occasionally typed in code and not used anywhare
}
CPP_OPTIONS += -std=c++0x # allow C++11 features
CPP_OPTIONS += -Wno-invalid-offsetof
USE_SYSTEM_LIBS = 1
!endif
# GCC debug build
!if ("$COMPILER" eq "GnuC") && 0
#!! should disable "-s" option from linker command
OPTIONS += -g3 -fno-omit-frame-pointer -funwind-tables -fstack-protector -fno-optimize-sibling-calls
LINKFLAGS += -rdynamic
!endif
DEFINES = $STDDEFS
#OPTIONS += -analyze
#------------------------------------------------
# Third-party libraries
#------------------------------------------------
LIBINCLUDES = $R/libs/include $R/libs
OBJDIR = $R/obj/libs-$PLATFORM
push(INCLUDES)
INCLUDES = $R/libs/nvtt
LIBINCLUDES += $R/libs/nvtt
sources(NV_LIBS) = {
# $R/libs/nvtt/nvcore/*.cpp
$R/libs/nvtt/nvimage/*.cpp
# $R/libs/nvtt/nvmath/*.cpp
# $R/libs/nvtt/nvtt/bc6h/*.cpp
# $R/libs/nvtt/nvtt/bc7/*.cpp
}
pop(INCLUDES)
# defines for smaller zlib
push(DEFINES)
push(INCLUDES)
DEFINES = $STDDEFS DYNAMIC_CRC_TABLE BUILDFIXED NO_GZIP
INCLUDES = $R/libs/include
# compression libraries
sources(COMP_LIBS) = {
# ... lzo for compressed UE3 packages
$R/libs/lzo/lzo_init.c
$R/libs/lzo/lzo1x_d2.c
# ... lzx for compressed XBox360 UE3 packages
$R/libs/mspack/lzxd.c
# ... lz4 for Gears of War 4
$R/libs/lz4/lz4.c
}
!if "$USE_SYSTEM_LIBS" eq "0"
# ... zlib for compressed UE3/UE4 packages
# zlib.h location: used from zlib source code and from UModel code.
# Default location for Linux is <zlib.h>
LIBINCLUDES += $R/libs/zlib # for using zlib in source code
INCLUDES += $R/libs/zlib # for building zlib itself
sources(COMP_LIBS) = {
$R/libs/zlib/*.c
}
# ... PNG for compressed source textures
LIBINCLUDES += $R/libs/libpng
DEFINES = $STDDEFS PNG_USER_CONFIG
sources(IMG_LIBS) = {
$R/libs/libpng/*.c
}
!else
STDLIBS += z png
!if !-e "/usr/include/png.h"
# Probably "png.h" include will fail, add "libpng" subdirectory to include paths
LIBINCLUDES += /usr/include/libpng
!endif
!endif
pop(INCLUDES)
pop(DEFINES)
!if -e "$R/libs/oodle/kraken.cpp"
DEFINES += HAS_OODLE
sources(COMP_LIBS) = {
$R/libs/oodle/*.cpp
}
!endif
sources(MOBILE_LIBS) = {
$R/libs/PowerVR/*.cpp
$R/libs/astc/*.cpp
}
LIBINCLUDES += $R/libs/PowerVR
LIBINCLUDES += $R/libs/detex
sources(IMG_LIBS) = {
$R/libs/detex/*.cpp
}
LIBINCLUDES += $R/libs/rijndael
sources(UE4_LIBS) = {
$R/libs/rijndael/*.c
}
#------------------------------------------------
# Project-specific options
#------------------------------------------------
OBJDIR = $R/obj/$PRJ-$PLATFORM
STDLIBS += SDL2
INCLUDES += . $R/Core $R/Unreal $LIBINCLUDES
OPTIONS += $WARNINGS
!if defined($DEBUG)
DEFINES += MAX_DEBUG
OBJDIR = $OBJDIR-debug
OPTIMIZE = none
!endif
!if "$PLATFORM" eq "win32"
INCLUDES += $R/libs/includewin32
LIBRARIES = $R/libs/SDL2/x86
!elif "$PLATFORM" eq "win64"
INCLUDES += $R/libs/includewin32
LIBRARIES = $R/libs/SDL2/x64
!endif