blob: 81f9ebafdf4fabc4b149e6a0bf56b57384a9f530 (
plain)
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
|
add_target("demo_c")
set_kind("binary")
add_deps("hello1")
add_files("*.c")
add_links("hello1")
add_linkdirs("$(buildir)")
add_includedirs("$(buildir)")
add_cflags("-DHELLO1")
if modes("release") then add_defines("NDEBUG") end
if options("option1") then add_defines("OPTION1") end
if options("option2") then add_defines("OPTION2") end
if options("option3") then add_defines("OPTION3") end
if options("option4") then add_defines("OPTION4") end
add_target("demo_cpp")
set_kind("binary")
add_deps("hello2")
add_files("*.cpp")
set_config_h("$(buildir)/demo_cpp.h")
add_linkdirs("$(buildir)")
add_includedirs("$(buildir)")
add_undefines("HELLO2")
add_cxxflags("-DHELLO1")
add_options("option1", "option2", "option3", "option4")
set_packagescript( function (target)
print("package: " .. target.name)
return 1
end)
if plats("macosx", "ios") then
add_target("demo_objc")
set_kind("binary")
add_deps("hello3")
add_files("*.m")
add_links("hello3")
add_linkdirs("$(buildir)/lib")
add_includedirs("$(buildir)/inc")
add_mflags("-DHELLO3", "-DPLAT=\"macosx\"", "-DARCH='armv7, arm64'")
add_target("demo_objcpp")
set_kind("binary")
add_deps("hello3")
add_files("*.mm")
add_mxflags("-DHELLO3")
add_ldflags("-L$(buildir)/lib", "-lhello3", "-lhello3")
if plats("ios") then
add_ldflags("-framework Cocoa", "-framework IOKit", "-framework CoreFoundation")
end
end
|