Skip to content

Commit

Permalink
update xmake.lua for xmake v2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Jun 2, 2016
1 parent 933d306 commit 11e81d8
Show file tree
Hide file tree
Showing 12 changed files with 145 additions and 142 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ build
cscope.*
gmon.out
tags
Doxyfile
10 changes: 5 additions & 5 deletions pkg/base.pkg/xmake.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
-- the base package
add_option("base")
option("base")

-- set category
set_option_category("package")
set_category("package")

-- add links
if os("windows") then add_option_links("ws2_32")
elseif os("android") then add_option_links("m", "c")
else add_option_links("pthread", "dl", "m", "c") end
if is_os("windows") then add_links("ws2_32")
elseif is_os("android") then add_links("m", "c")
else add_links("pthread", "dl", "m", "c") end

18 changes: 9 additions & 9 deletions pkg/mysql.pkg/xmake.lua
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
-- the mysql package
add_option("mysql")
option("mysql")

-- show menu
set_option_showmenu(true)
set_showmenu(true)

-- set category
set_option_category("package")
set_category("package")

-- set description
set_option_description("The mysql package")
set_description("The mysql package")

-- add defines to config.h if checking ok
add_option_defines_h_if_ok("$(prefix)_PACKAGE_HAVE_MYSQL")
add_defines_h_if_ok("$(prefix)_PACKAGE_HAVE_MYSQL")

-- add links for checking
add_option_links("mysqlclient")
add_links("mysqlclient")

-- add link directories
add_option_linkdirs("lib/$(plat)/$(arch)")
add_linkdirs("lib/$(plat)/$(arch)")

-- add c includes for checking
add_option_cincludes("mysql/mysql.h")
add_cincludes("mysql/mysql.h")

-- add include directories
add_option_includedirs("inc/$(plat)", "inc")
add_includedirs("inc/$(plat)", "inc")


18 changes: 9 additions & 9 deletions pkg/openssl.pkg/xmake.lua
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
-- the openssl package
add_option("openssl")
option("openssl")

-- show menu
set_option_showmenu(true)
set_showmenu(true)

-- set category
set_option_category("package")
set_category("package")

-- set description
set_option_description("The openssl package")
set_description("The openssl package")

-- add defines to config.h if checking ok
add_option_defines_h_if_ok("$(prefix)_PACKAGE_HAVE_OPENSSL")
add_defines_h_if_ok("$(prefix)_PACKAGE_HAVE_OPENSSL")

-- add links for checking
add_option_links("ssl", "crypto")
add_links("ssl", "crypto")

-- add link directories
add_option_linkdirs("lib/$(plat)/$(arch)")
add_linkdirs("lib/$(plat)/$(arch)")

-- add c includes for checking
add_option_cincludes("openssl/openssl.h")
add_cincludes("openssl/openssl.h")

-- add include directories
add_option_includedirs("inc/$(plat)", "inc")
add_includedirs("inc/$(plat)", "inc")

20 changes: 10 additions & 10 deletions pkg/pcre.pkg/xmake.lua
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
-- add pcre package
add_option("pcre")
option("pcre")

-- show menu
set_option_showmenu(true)
set_showmenu(true)

-- set category
set_option_category("package")
set_category("package")

-- set description
set_option_description("The pcre package")
set_description("The pcre package")

-- add defines to config.h if checking ok
add_option_defines_h_if_ok("$(prefix)_PACKAGE_HAVE_PCRE")
add_defines_h_if_ok("$(prefix)_PACKAGE_HAVE_PCRE")

-- add links for checking
add_option_links("pcre")
add_links("pcre")

-- add link directories
add_option_linkdirs("lib/$(plat)/$(arch)")
add_linkdirs("lib/$(plat)/$(arch)")

-- add c includes for checking
add_option_cincludes("pcre/pcre.h")
add_cincludes("pcre/pcre.h")

-- add include directories
add_option_includedirs("inc/$(plat)", "inc")
add_includedirs("inc/$(plat)", "inc")

-- add c functions
add_option_cfuncs("pcre_compile")
add_cfuncs("pcre_compile")
22 changes: 11 additions & 11 deletions pkg/pcre2.pkg/xmake.lua
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
-- add pcre2 package
add_option("pcre2")
option("pcre2")

-- show menu
set_option_showmenu(true)
set_showmenu(true)

-- set category
set_option_category("package")
set_category("package")

-- set description
set_option_description("The pcre2 package")
set_description("The pcre2 package")

-- add defines to config.h if checking ok
add_option_defines_h_if_ok("$(prefix)_PACKAGE_HAVE_PCRE2")
add_defines_h_if_ok("$(prefix)_PACKAGE_HAVE_PCRE2")

-- add defines for checking
add_option_defines("PCRE2_CODE_UNIT_WIDTH=8")
add_defines("PCRE2_CODE_UNIT_WIDTH=8")

-- add links for checking
add_option_links("pcre2-8")
add_links("pcre2-8")

-- add link directories
add_option_linkdirs("lib/$(plat)/$(arch)")
add_linkdirs("lib/$(plat)/$(arch)")

-- add c includes for checking
add_option_cincludes("pcre2/pcre2.h")
add_cincludes("pcre2/pcre2.h")

-- add include directories
add_option_includedirs("inc/$(plat)", "inc")
add_includedirs("inc/$(plat)", "inc")

-- add c functions
add_option_cfuncs("pcre2_compile")
add_cfuncs("pcre2_compile")
18 changes: 9 additions & 9 deletions pkg/polarssl.pkg/xmake.lua
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
-- add polarssl package
add_option("polarssl")
option("polarssl")

-- show menu
set_option_showmenu(true)
set_showmenu(true)

-- set category
set_option_category("package")
set_category("package")

-- set description
set_option_description("The polarssl package")
set_description("The polarssl package")

-- add defines to config.h if checking ok
add_option_defines_h_if_ok("$(prefix)_PACKAGE_HAVE_POLARSSL")
add_defines_h_if_ok("$(prefix)_PACKAGE_HAVE_POLARSSL")

-- add links for checking
add_option_links("polarssl")
add_links("polarssl")

-- add link directories
add_option_linkdirs("lib/$(plat)/$(arch)")
add_linkdirs("lib/$(plat)/$(arch)")

-- add c includes for checking
add_option_cincludes("polarssl/polarssl.h")
add_cincludes("polarssl/polarssl.h")

-- add include directories
add_option_includedirs("inc/$(plat)", "inc")
add_includedirs("inc/$(plat)", "inc")

18 changes: 9 additions & 9 deletions pkg/sqlite3.pkg/xmake.lua
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
-- add sqlite3 package
add_option("sqlite3")
option("sqlite3")

-- show menu
set_option_showmenu(true)
set_showmenu(true)

-- set category
set_option_category("package")
set_category("package")

-- set description
set_option_description("The sqlite3 package")
set_description("The sqlite3 package")

-- add defines to config.h if checking ok
add_option_defines_h_if_ok("$(prefix)_PACKAGE_HAVE_SQLITE3")
add_defines_h_if_ok("$(prefix)_PACKAGE_HAVE_SQLITE3")

-- add links for checking
add_option_links("sqlite3")
add_links("sqlite3")

-- add link directories
add_option_linkdirs("lib/$(plat)/$(arch)")
add_linkdirs("lib/$(plat)/$(arch)")

-- add c includes for checking
add_option_cincludes("sqlite3/sqlite3.h")
add_cincludes("sqlite3/sqlite3.h")

-- add include directories
add_option_includedirs("inc/$(plat)", "inc")
add_includedirs("inc/$(plat)", "inc")


18 changes: 9 additions & 9 deletions pkg/zlib.pkg/xmake.lua
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
-- add zlib package
add_option("zlib")
option("zlib")

-- show menu
set_option_showmenu(true)
set_showmenu(true)

-- set category
set_option_category("package")
set_category("package")

-- set description
set_option_description("The zlib package")
set_description("The zlib package")

-- add defines to config.h if checking ok
add_option_defines_h_if_ok("$(prefix)_PACKAGE_HAVE_ZLIB")
add_defines_h_if_ok("$(prefix)_PACKAGE_HAVE_ZLIB")

-- add links for checking
add_option_links("z")
add_links("z")

-- add link directories
add_option_linkdirs("lib/$(plat)/$(arch)")
add_linkdirs("lib/$(plat)/$(arch)")

-- add c includes for checking
add_option_cincludes("zlib/zlib.h")
add_cincludes("zlib/zlib.h")

-- add include directories
add_option_includedirs("inc/$(plat)", "inc")
add_includedirs("inc/$(plat)", "inc")
20 changes: 10 additions & 10 deletions src/demo/xmake.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

-- add target
add_target("demo")
target("demo")

-- add the dependent target
add_deps("tbox")
Expand Down Expand Up @@ -43,14 +43,14 @@ add_target("demo")
add_files("stream/stream/*.c")

-- add the source files for the float type
if options("float") then
if is_option("float") then
add_files("math/fixed.c")
add_files("libm/float.c")
add_files("libm/double.c")
end

-- add the source files for the thread type
if options("thread") then
if is_option("thread") then
add_files("platform/thread*.c")
add_files("platform/event.c")
add_files("platform/lock.c")
Expand All @@ -61,22 +61,22 @@ add_target("demo")
end

-- add the source files for the xml module
if options("xml") then
if is_option("xml") then
add_files("xml/*.c")
end

-- add the source files for the regex module
if options("regex") then
if is_option("regex") then
add_files("regex/*.c")
end

-- add the source files for the network type
if options("network") then
if is_option("network") then
add_files("network/**.c")
end

-- add the source files for the asio module
if options("asio") then
if is_option("asio") then
add_files("asio/*.c")
add_files("stream/async_stream.c")
add_files("stream/transfer_pool.c")
Expand All @@ -85,14 +85,14 @@ add_target("demo")
end

-- add the source files for the object module
if options("object") then
if is_option("object") then
add_files("utils/option.c")
add_files("object/*.c")
end

-- add the source files for the charset module
if options("charset") then add_files("other/charset.c") end
if is_option("charset") then add_files("other/charset.c") end

-- add the source files for the database module
if options("database") then add_files("database/sql.c") end
if is_option("database") then add_files("database/sql.c") end

Loading

0 comments on commit 11e81d8

Please sign in to comment.