-
Notifications
You must be signed in to change notification settings - Fork 5
/
premake5.lua
74 lines (63 loc) · 1.9 KB
/
premake5.lua
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
workspace "tcp-over-kcp"
configurations { "Debug", "Release" }
flags{"NoPCH","RelativeLinks"}
location "./"
architecture "x64"
libdirs("./")
filter "configurations:Debug"
defines { "DEBUG" }
symbols "On"
libdirs("./libs/Debug")
filter "configurations:Release"
defines { "NDEBUG" }
optimize "On"
symbols "On"
libdirs("./libs/Release")
filter {"system:windows"}
characterset "MBCS"
systemversion "latest"
warnings "Extra"
filter { "system:linux" }
warnings "High"
filter { "system:macosx" }
warnings "High"
project "kcp"
location "build/projects/kcp"
objdir "build/obj/%{cfg.project.name}/%{cfg.platform}_%{cfg.buildcfg}"
targetdir "build/bin/%{cfg.buildcfg}"
kind "StaticLib"
language "C"
includedirs {
"./3rd/kcp",
}
files {"./3rd/**.h", "./3rd/**.c"}
project "tcp_over_kcp"
location "build/projects/tcp_over_kcp"
objdir "build/obj/%{cfg.project.name}/%{cfg.platform}_%{cfg.buildcfg}"
targetdir "build/bin/%{cfg.buildcfg}"
kind "ConsoleApp"
language "C++"
includedirs {
"./3rd",
"./include",
"./example",
}
files {"./example/**.h", "./example/**.hpp","./example/**.cpp"}
defines {
"ASIO_STANDALONE" ,
"ASIO_NO_DEPRECATED",
--"ASIO_ENABLE_HANDLER_TRACKING"
}
links{"kcp"}
filter { "system:windows" }
cppdialect "C++17"
defines {"_WIN32_WINNT=0x0601"}
buildoptions { "/await" }
filter {"system:linux"}
buildoptions {"-std=c++20"}
links{"pthread"}
linkoptions {"-static-libstdc++ -static-libgcc","-Wl,-rpath=./","-Wl,--as-needed"}
filter "configurations:Debug"
targetsuffix "-d"
filter{"configurations:*"}
postbuildcommands{"{COPY} %{cfg.buildtarget.abspath} %{wks.location}"}