forked from gildor2/UEViewer
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcommon.project
152 lines (118 loc) · 3.95 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
# 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 # OLDCRT=0 is required for VS2015+ (TODO: try to fix that)
!endif
#?? TODO: UE3_LIBS seems combines all libraries used in UModel, but which aren't for UE3 exactly. Should I rename the constant?
#------------------------------------------------
# Compiler-specific options
#------------------------------------------------
WARNINGS = # warnings for our source code (i.e. excluding thirs-parties), empty by default
!if "$COMPILER" eq "VisualC"
CPP_EXCEPT = 0 # used with WIN32_USE_SEH in Core.h
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"
DEFINES += OLDCRT
!include $WDKCRT/msvcrt.project
!endif
!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 += -std=c++0x # allow C++11 features (Warning!! - C++ only option)
OPTIONS += -fno-strict-aliasing # required for our uint_cast()-based FP hacks
OPTIONS += -fno-stack-protector # this will remove GLIBC_2.4 dependency
OPTIONS += {
# disable some warnings
-Wno-invalid-offsetof #?? this flag is for C++ only, not for C
}
!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
#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 = DYNAMIC_CRC_TABLE BUILDFIXED NO_GZIP
INCLUDES = $R/libs/include
sources(UE3_LIBS) = {
# ... lzo for compressed UE3 packages
$R/libs/lzo/lzo_init.c
$R/libs/lzo/lzo1x_d2.c
# ... zlib for compressed UE3/UE4 packages
$R/libs/zlib/*.c
# ... lzx for compresses XBox360 UE3 packages
$R/libs/mspack/lzxd.c
# ... lz4 for Gears of War 4
$R/libs/lz4/lz4.c
}
# ... PNG for compressed source textures
INCLUDES += $R/libs/zlib
DEFINES = PNG_USER_CONFIG
sources(UE3_LIBS) = {
$R/libs/libpng/*.c
}
pop(INCLUDES)
pop(DEFINES)
sources(MOBILE_LIBS) = {
$R/libs/PowerVR/*.cpp
$R/libs/astc/*.cpp
}
LIBINCLUDES += $R/libs/PowerVR
LIBINCLUDES += $R/libs/detex
sources(UE3_LIBS) = {
$R/libs/detex/*.cpp
}
# TODO: AES code used for UE4, but added to UE3_LIBS
LIBINCLUDES += $R/libs/rijndael
sources(UE3_LIBS) = {
$R/libs/rijndael/*.c
}
#------------------------------------------------
# Project-specific options
#------------------------------------------------
OBJDIR = $R/obj/$PRJ-$PLATFORM
STDLIBS += SDL2
INCLUDES += . $R/Core $R/Unreal $LIBINCLUDES
OPTIONS += $WARNINGS
!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