Ticket #1516: 0ad-r11339-trac-1421.patch
File 0ad-r11339-trac-1421.patch, 8.3 KB (added by , 12 years ago) |
---|
-
0ad-r11863-alpha/build/premake/premake4.lua
diff -up 0ad-r11863-alpha/build/premake/premake4.lua.orig 0ad-r11863-alpha/build/premake/premake4.lua
old new newoption { trigger = "icc", description 7 7 newoption { trigger = "outpath", description = "Location for generated project files" } 8 8 newoption { trigger = "without-fam", description = "Disable use of FAM API on Linux" } 9 9 newoption { trigger = "without-audio", description = "Disable use of OpenAL/Ogg/Vorbis APIs" } 10 newoption { trigger = "minimal-flags", description = "Only set compiler/linker flags that are really needed" } 10 11 newoption { trigger = "without-nvtt", description = "Disable use of NVTT" } 11 12 newoption { trigger = "without-tests", description = "Disable generation of test projects" } 12 13 newoption { trigger = "without-pch", description = "Disable generation and usage of precompiled headers" } … … end 135 136 function project_set_build_flags() 136 137 137 138 flags { "Symbols", "NoEditAndContinue" } 138 if not _OPTIONS["icc"] then139 if not _OPTIONS["icc"] and not _OPTIONS["minimal-flags"] then 139 140 -- adds the -Wall compiler flag 140 141 flags { "ExtraWarnings" } -- this causes far too many warnings/remarks on ICC 141 142 end … … function project_set_build_flags() 144 145 defines { "DEBUG" } 145 146 146 147 configuration "Release" 147 flags { "OptimizeSpeed" } 148 if not _OPTIONS["minimal-flags"] then 149 flags { "OptimizeSpeed" } 150 end 148 151 defines { "NDEBUG", "CONFIG_FINAL=1" } 149 152 150 153 configuration { } … … function project_set_build_flags() 196 199 linkoptions { "-multiply_defined","suppress" } 197 200 end 198 201 else 199 buildoptions { 200 -- enable most of the standard warnings 201 "-Wno-switch", -- enumeration value not handled in switch (this is sometimes useful, but results in lots of noise) 202 "-Wno-reorder", -- order of initialization list in constructors (lots of noise) 203 "-Wno-invalid-offsetof", -- offsetof on non-POD types (see comment in renderer/PatchRData.cpp) 204 205 "-Wextra", 206 "-Wno-missing-field-initializers", -- (this is common in external headers we can't fix) 207 208 -- add some other useful warnings that need to be enabled explicitly 209 "-Wunused-parameter", 210 "-Wredundant-decls", -- (useful for finding some multiply-included header files) 211 -- "-Wformat=2", -- (useful sometimes, but a bit noisy, so skip it by default) 212 -- "-Wcast-qual", -- (useful for checking const-correctness, but a bit noisy, so skip it by default) 213 "-Wnon-virtual-dtor", -- (sometimes noisy but finds real bugs) 214 "-Wundef", -- (useful for finding macro name typos) 215 216 -- enable security features (stack checking etc) that shouldn't have 217 -- a significant effect on performance and can catch bugs 218 "-fstack-protector-all", 219 "-D_FORTIFY_SOURCE=2", 220 221 -- always enable strict aliasing (useful in debug builds because of the warnings) 222 "-fstrict-aliasing", 223 224 -- do something (?) so that ccache can handle compilation with PCH enabled 225 "-fpch-preprocess", 226 227 -- don't omit frame pointers (for now), because performance will be impacted 228 -- negatively by the way this breaks profilers more than it will be impacted 229 -- positively by the optimisation 230 "-fno-omit-frame-pointer" 231 } 202 if not _OPTIONS["minimal-flags"] then 203 buildoptions { 204 -- enable most of the standard warnings 205 "-Wno-switch", -- enumeration value not handled in switch (this is sometimes useful, but results in lots of noise) 206 "-Wno-reorder", -- order of initialization list in constructors (lots of noise) 207 "-Wno-invalid-offsetof", -- offsetof on non-POD types (see comment in renderer/PatchRData.cpp) 208 209 "-Wextra", 210 "-Wno-missing-field-initializers", -- (this is common in external headers we can't fix) 211 212 -- add some other useful warnings that need to be enabled explicitly 213 "-Wunused-parameter", 214 "-Wredundant-decls", -- (useful for finding some multiply-included header files) 215 -- "-Wformat=2", -- (useful sometimes, but a bit noisy, so skip it by default) 216 -- "-Wcast-qual", -- (useful for checking const-correctness, but a bit noisy, so skip it by default) 217 "-Wnon-virtual-dtor", -- (sometimes noisy but finds real bugs) 218 "-Wundef", -- (useful for finding macro name typos) 219 220 -- enable security features (stack checking etc) that shouldn't have 221 -- a significant effect on performance and can catch bugs 222 "-fstack-protector-all", 223 "-D_FORTIFY_SOURCE=2", 224 225 -- always enable strict aliasing (useful in debug builds because of the warnings) 226 "-fstrict-aliasing", 227 228 -- do something (?) so that ccache can handle compilation with PCH enabled 229 "-fpch-preprocess", 230 231 -- don't omit frame pointers (for now), because performance will be impacted 232 -- negatively by the way this breaks profilers more than it will be impacted 233 -- positively by the optimisation 234 "-fno-omit-frame-pointer" 235 } 236 end 232 237 233 if arch == "x86" or arch == "amd64"then238 if (arch == "x86" or arch == "amd64") and not _OPTIONS["minimal-flags"] then 234 239 buildoptions { 235 240 -- enable SSE intrinsics 236 241 "-msse" … … function project_set_build_flags() 245 250 buildoptions { "-mthumb -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp" } 246 251 end 247 252 248 if os.is("linux") or os.is("bsd")then253 if (os.is("linux") or os.is("bsd")) and not _OPTIONS["minimal-flags"] then 249 254 linkoptions { "-Wl,--no-undefined", "-Wl,--as-needed" } 250 255 end 251 256 … … function project_set_build_flags() 256 261 257 262 -- To support intrinsics like __sync_bool_compare_and_swap on x86 258 263 -- we need to set -march to something that supports them 259 if arch == "x86" then264 if arch == "x86" and not _OPTIONS["minimal-flags"] then 260 265 buildoptions { "-march=i686" } 261 266 end 262 267 … … function project_set_build_flags() 267 272 end 268 273 end 269 274 270 buildoptions { 271 -- Hide symbols in dynamic shared objects by default, for efficiency and for equivalence with 272 -- Windows - they should be exported explicitly with __attribute__ ((visibility ("default"))) 273 "-fvisibility=hidden" 274 } 275 if not _OPTIONS["minimal-flags"] then 276 buildoptions { 277 -- Hide symbols in dynamic shared objects by default, for efficiency and for equivalence with 278 -- Windows - they should be exported explicitly with __attribute__ ((visibility ("default"))) 279 "-fvisibility=hidden" 280 } 281 end 275 282 276 283 -- X11 includes may be installed in one of a gadzillion of three places 277 284 -- Famous last words: "You can't include too much! ;-)" … … function project_set_build_flags() 292 299 defines { "INSTALLED_LIBDIR=" .. _OPTIONS["libdir"] } 293 300 end 294 301 295 if os.is("linux") or os.is("bsd") then 302 -- TODO add "minimal-flags" here too? 303 if (os.is("linux") or os.is("bsd")) and not _OPTIONS["with-system-mozjs185"] then 296 304 -- To use our local SpiderMonkey library, it needs to be part of the 297 305 -- runtime dynamic linker path. Add it with -rpath to make sure it gets found. 298 306 if _OPTIONS["libdir"] then … … function project_create(project_name, ta 325 333 326 334 project_set_target(project_name) 327 335 project_set_build_flags() 336 337 if _OPTIONS["minimal-flags"] then 338 flags { "Symbols" } 339 end 328 340 end 329 341 330 342 … … function setup_atlas_project(project_nam 841 853 -- install_name settings aren't really supported yet by premake, but there are plans for the future. 842 854 -- we currently use this hack to work around some bugs with wrong install_names. 843 855 if target_type == "SharedLib" then 844 linkoptions { "-install_name @executable_path/lib"..project_name..".dylib" } 856 linkoptions { "-install_name @executable_path/lib"..project_name..".dylib" } 845 857 end 846 858 end 847 859 … … function setup_collada_project(project_n 1027 1039 -- install_name settings aren't really supported yet by premake, but there are plans for the future. 1028 1040 -- we currently use this hack to work around some bugs with wrong install_names. 1029 1041 if target_type == "SharedLib" then 1030 linkoptions { "-install_name @executable_path/lib"..project_name..".dylib" } 1042 linkoptions { "-install_name @executable_path/lib"..project_name..".dylib" } 1031 1043 end 1032 1044 1033 1045 buildoptions { "-fno-strict-aliasing" }