| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
local action = _ACTION or "" |
| 7 |
local todir = "Build/" .. action |
| 8 |
|
| 9 |
workspace "recastnavigation" |
| 10 |
configurations { |
| 11 |
"Debug", |
| 12 |
"Release" |
| 13 |
} |
| 14 |
|
| 15 |
location (todir) |
| 16 |
|
| 17 |
floatingpoint "Fast" |
| 18 |
exceptionhandling "Off" |
| 19 |
rtti "Off" |
| 20 |
symbols "On" |
| 21 |
flags { "FatalCompileWarnings" } |
| 22 |
cppdialect "C++98" |
| 23 |
|
| 24 |
|
| 25 |
filter "configurations:Debug" |
| 26 |
defines { "DEBUG" } |
| 27 |
targetdir ( todir .. "/lib/Debug" ) |
| 28 |
|
| 29 |
|
| 30 |
filter "configurations:Release" |
| •31 |
defines { "RC_DISABLE_ASSERTS" } |
| 32 |
optimize "On" |
| 33 |
targetdir ( todir .. "/lib/Release" ) |
| 34 |
|
| 35 |
filter "system:not windows" |
| 36 |
warnings "Extra" |
| 37 |
|
| 38 |
|
| 39 |
filter "system:windows" |
| 40 |
platforms { "Win32", "Win64" } |
| 41 |
defines { "WIN32", "_WINDOWS", "_CRT_SECURE_NO_WARNINGS", "_HAS_EXCEPTIONS=0" } |
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
buildoptions { "/W3", "/wd4351" } |
| 46 |
|
| 47 |
filter "platforms:Win32" |
| 48 |
architecture "x32" |
| 49 |
|
| 50 |
filter "platforms:Win64" |
| 51 |
architecture "x64" |
| 52 |
|
| 53 |
project "DebugUtils" |
| 54 |
language "C++" |
| 55 |
kind "StaticLib" |
| 56 |
includedirs { |
| 57 |
"../DebugUtils/Include", |
| 58 |
"../Detour/Include", |
| 59 |
"../DetourTileCache/Include", |
| 60 |
"../Recast/Include" |
| 61 |
} |
| 62 |
files { |
| 63 |
"../DebugUtils/Include/*.h", |
| 64 |
"../DebugUtils/Source/*.cpp" |
| 65 |
} |
| 66 |
|
| 67 |
project "Detour" |
| 68 |
language "C++" |
| 69 |
kind "StaticLib" |
| 70 |
includedirs { |
| 71 |
"../Detour/Include" |
| 72 |
} |
| 73 |
files { |
| 74 |
"../Detour/Include/*.h", |
| 75 |
"../Detour/Source/*.cpp" |
| 76 |
} |
| 77 |
|
| 78 |
filter {"system:linux", "toolset:gcc"} |
| 79 |
buildoptions { |
| 80 |
"-Wno-error=class-memaccess", |
| 81 |
"-Wno-error=maybe-uninitialized" |
| 82 |
} |
| 83 |
|
| 84 |
project "DetourCrowd" |
| 85 |
language "C++" |
| 86 |
kind "StaticLib" |
| 87 |
includedirs { |
| 88 |
"../DetourCrowd/Include", |
| 89 |
"../Detour/Include", |
| 90 |
"../Recast/Include" |
| 91 |
} |
| 92 |
files { |
| 93 |
"../DetourCrowd/Include/*.h", |
| 94 |
"../DetourCrowd/Source/*.cpp" |
| 95 |
} |
| 96 |
|
| 97 |
project "DetourTileCache" |
| 98 |
language "C++" |
| 99 |
kind "StaticLib" |
| 100 |
includedirs { |
| 101 |
"../DetourTileCache/Include", |
| 102 |
"../Detour/Include", |
| 103 |
"../Recast/Include" |
| 104 |
} |
| 105 |
files { |
| 106 |
"../DetourTileCache/Include/*.h", |
| 107 |
"../DetourTileCache/Source/*.cpp" |
| 108 |
} |
| 109 |
|
| 110 |
project "Recast" |
| 111 |
language "C++" |
| 112 |
kind "StaticLib" |
| 113 |
includedirs { |
| 114 |
"../Recast/Include" |
| 115 |
} |
| 116 |
files { |
| 117 |
"../Recast/Include/*.h", |
| 118 |
"../Recast/Source/*.cpp" |
| 119 |
} |
| 120 |
|
| 121 |
project "RecastDemo" |
| 122 |
language "C++" |
| 123 |
kind "WindowedApp" |
| 124 |
includedirs { |
| 125 |
"../RecastDemo/Include", |
| 126 |
"../RecastDemo/Contrib", |
| 127 |
"../RecastDemo/Contrib/fastlz", |
| 128 |
"../DebugUtils/Include", |
| 129 |
"../Detour/Include", |
| 130 |
"../DetourCrowd/Include", |
| 131 |
"../DetourTileCache/Include", |
| 132 |
"../Recast/Include" |
| 133 |
} |
| 134 |
files { |
| 135 |
"../RecastDemo/Include/*.h", |
| 136 |
"../RecastDemo/Source/*.cpp", |
| 137 |
"../RecastDemo/Contrib/fastlz/*.h", |
| 138 |
"../RecastDemo/Contrib/fastlz/*.c" |
| 139 |
} |
| 140 |
|
| 141 |
|
| 142 |
links { |
| 143 |
"DebugUtils", |
| 144 |
"Detour", |
| 145 |
"DetourCrowd", |
| 146 |
"DetourTileCache", |
| 147 |
"Recast" |
| 148 |
} |
| 149 |
|
| 150 |
|
| 151 |
targetdir "Bin" |
| 152 |
|
| 153 |
|
| 154 |
filter "system:linux" |
| 155 |
buildoptions { |
| 156 |
"`pkg-config --cflags sdl2`", |
| 157 |
"`pkg-config --cflags gl`", |
| 158 |
"`pkg-config --cflags glu`", |
| 159 |
"-Wno-ignored-qualifiers", |
| 160 |
} |
| 161 |
linkoptions { |
| 162 |
"`pkg-config --libs sdl2`", |
| 163 |
"`pkg-config --libs gl`", |
| 164 |
"`pkg-config --libs glu`" |
| 165 |
} |
| 166 |
|
| 167 |
filter { "system:linux", "toolset:gcc", "files:*.c" } |
| 168 |
buildoptions { |
| 169 |
"-Wno-class-memaccess" |
| 170 |
} |
| 171 |
|
| 172 |
|
| 173 |
filter "system:windows" |
| 174 |
includedirs { "../RecastDemo/Contrib/SDL/include" } |
| 175 |
libdirs { "../RecastDemo/Contrib/SDL/lib/%{cfg.architecture:gsub('x86_64', 'x64')}" } |
| 176 |
debugdir "../RecastDemo/Bin/" |
| 177 |
links { |
| 178 |
"glu32", |
| 179 |
"opengl32", |
| 180 |
"SDL2", |
| 181 |
"SDL2main", |
| 182 |
} |
| 183 |
postbuildcommands { |
| 184 |
|
| 185 |
'{COPY} "%{path.getabsolute("Contrib/SDL/lib/" .. cfg.architecture:gsub("x86_64", "x64") .. "/SDL2.dll")}" "%{cfg.targetdir}"' |
| 186 |
} |
| 187 |
|
| 188 |
|
| 189 |
filter "system:macosx" |
| 190 |
kind "ConsoleApp" |
| 191 |
includedirs { "Bin/SDL2.framework/Headers" } |
| 192 |
links { |
| 193 |
"OpenGL.framework", |
| 194 |
"SDL2.framework", |
| 195 |
"Cocoa.framework", |
| 196 |
} |
| 197 |
|
| 198 |
project "Tests" |
| 199 |
language "C++" |
| 200 |
kind "ConsoleApp" |
| 201 |
cppdialect "C++14" |
| 202 |
|
| 203 |
|
| 204 |
exceptionhandling "On" |
| 205 |
rtti "On" |
| 206 |
|
| 207 |
includedirs { |
| 208 |
"../DebugUtils/Include", |
| 209 |
"../Detour/Include", |
| 210 |
"../DetourCrowd/Include", |
| 211 |
"../DetourTileCache/Include", |
| 212 |
"../Recast/Include", |
| 213 |
"../Recast/Source", |
| 214 |
"../Tests/Recast", |
| 215 |
"../Tests", |
| 216 |
"../Tests/Contrib" |
| 217 |
} |
| 218 |
files { |
| 219 |
"../Tests/*.h", |
| 220 |
"../Tests/*.hpp", |
| 221 |
"../Tests/*.cpp", |
| 222 |
"../Tests/Recast/*.h", |
| 223 |
"../Tests/Recast/*.cpp", |
| 224 |
"../Tests/Detour/*.h", |
| 225 |
"../Tests/Detour/*.cpp", |
| •226 |
"../Tests/DetourCrowd/*.cpp", |
| 227 |
"../Tests/Contrib/catch2/*.cpp" |
| 228 |
} |
| 229 |
|
| 230 |
|
| 231 |
links { |
| 232 |
"DebugUtils", |
| 233 |
"DetourCrowd", |
| •234 |
"Detour", |
| 235 |
"DetourTileCache", |
| 236 |
"Recast", |
| 237 |
} |
| 238 |
|
| 239 |
|
| 240 |
targetdir "Bin" |
| 241 |
|
| 242 |
|
| 243 |
filter "toolset:clang" |
| 244 |
buildoptions { "-fsanitize=undefined", "-fsanitize=address" } |
| 245 |
linkoptions { "-fsanitize=undefined", "-fsanitize=address" } |
| 246 |
|
| 247 |
|
| 248 |
filter "system:linux" |
| 249 |
buildoptions { |
| 250 |
"`pkg-config --cflags sdl2`", |
| 251 |
"`pkg-config --cflags gl`", |
| 252 |
"`pkg-config --cflags glu`", |
| 253 |
"-Wno-parentheses" |
| 254 |
} |
| 255 |
linkoptions { |
| 256 |
"`pkg-config --libs sdl2`", |
| 257 |
"`pkg-config --libs gl`", |
| 258 |
"`pkg-config --libs glu`", |
| 259 |
"-lpthread" |
| 260 |
} |
| 261 |
|
| 262 |
|
| 263 |
filter "system:windows" |
| 264 |
includedirs { "../RecastDemo/Contrib/SDL/include" } |
| 265 |
libdirs { "../RecastDemo/Contrib/SDL/lib/%{cfg.architecture:gsub('x86_64', 'x64')}" } |
| 266 |
debugdir "../RecastDemo/Bin/" |
| 267 |
links { |
| 268 |
"glu32", |
| 269 |
"opengl32", |
| 270 |
"SDL2", |
| 271 |
"SDL2main", |
| 272 |
} |
| 273 |
|
| 274 |
|
| 275 |
filter "system:macosx" |
| 276 |
kind "ConsoleApp" |
| 277 |
links { |
| 278 |
"Cocoa.framework", |
| 279 |
} |