diff options
| author | ruki <[email protected]> | 2020-04-22 22:34:55 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-04-22 09:29:34 +0800 |
| commit | 15dc39430ed49d42709bba3ef2acab8500414a3a (patch) | |
| tree | 21b5fe80d575cf9a1604c5edce5940504ede17c7 | |
| parent | e273a770ecd7917f29f013904d3c4b8201af307c (diff) | |
add xmake.cli rule
| -rw-r--r-- | tests/projects/xmake_cli/xmake/src/main.c (renamed from tests/projects/c/xmake_app/src/main.c) | 1 | ||||
| -rw-r--r-- | tests/projects/xmake_cli/xmake/src/xmake.ico | bin | 0 -> 119943 bytes | |||
| -rw-r--r-- | tests/projects/xmake_cli/xmake/src/xmake.rc | 43 | ||||
| -rw-r--r-- | tests/projects/xmake_cli/xmake/xmake.lua (renamed from tests/projects/c/xmake_app/xmake.lua) | 7 | ||||
| -rw-r--r-- | xmake/rules/xmake_cli/xmake.lua | 25 |
5 files changed, 73 insertions, 3 deletions
diff --git a/tests/projects/c/xmake_app/src/main.c b/tests/projects/xmake_cli/xmake/src/main.c index b8570daae..6e75791ed 100644 --- a/tests/projects/c/xmake_app/src/main.c +++ b/tests/projects/xmake_cli/xmake/src/main.c @@ -11,7 +11,6 @@ tb_int_t main(tb_int_t argc, tb_char_t** argv) ok = xm_engine_main(engine, argc, argv); xm_engine_exit(engine); } - xm_exit(); } return ok; diff --git a/tests/projects/xmake_cli/xmake/src/xmake.ico b/tests/projects/xmake_cli/xmake/src/xmake.ico Binary files differnew file mode 100644 index 000000000..52c8ef389 --- /dev/null +++ b/tests/projects/xmake_cli/xmake/src/xmake.ico diff --git a/tests/projects/xmake_cli/xmake/src/xmake.rc b/tests/projects/xmake_cli/xmake/src/xmake.rc new file mode 100644 index 000000000..0d737ebc3 --- /dev/null +++ b/tests/projects/xmake_cli/xmake/src/xmake.rc @@ -0,0 +1,43 @@ +#include "xmake.config.h" +#include "winres.h" + +#define _STR(x) #x +#define STR(x) _STR(x) + +VS_VERSION_INFO VERSIONINFO + FILEVERSION XM_CONFIG_VERSION_MAJOR, XM_CONFIG_VERSION_MINOR, XM_CONFIG_VERSION_ALTER, 0 + PRODUCTVERSION XM_CONFIG_VERSION_MAJOR, XM_CONFIG_VERSION_MINOR, XM_CONFIG_VERSION_ALTER, 0 + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE VFT2_UNKNOWN +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004B0" + BEGIN + VALUE "Comments", "A cross-platform build utility based on Lua\nwebsite: https://xmake.io" + VALUE "CompanyName", "The TBOOX Open Source Group" + VALUE "FileDescription", "XMake build utility" + VALUE "FileVersion", XM_CONFIG_VERSION "+" STR(XM_CONFIG_VERSION_BUILD) + VALUE "InternalName", "xmake" + VALUE "LegalCopyright", "Copyright (C) 2015-2020 Ruki Wang, tboox.org, xmake.io\nCopyright (C) 2005-2015 Mike Pall, luajit.org" + VALUE "LegalTrademarks", "" + VALUE "OriginalFilename", "xmake.exe" + VALUE "ProductName", "XMake" + VALUE "ProductVersion", XM_CONFIG_VERSION "+" STR(XM_CONFIG_VERSION_BUILD) + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0, 1200 + END +END + + +IDI_APP ICON DISCARDABLE "xmake.ico" diff --git a/tests/projects/c/xmake_app/xmake.lua b/tests/projects/xmake_cli/xmake/xmake.lua index 42266ead7..e00d7e14d 100644 --- a/tests/projects/c/xmake_app/xmake.lua +++ b/tests/projects/xmake_cli/xmake/xmake.lua @@ -1,7 +1,10 @@ add_rules("mode.debug", "mode.release") add_requires("libxmake") -target("test") - set_kind("binary") +target("xmake") + add_rules("xmake.cli") add_files("src/*.c") + if is_plat("windows") then + add_files("src/*.rc") + end add_packages("libxmake") diff --git a/xmake/rules/xmake_cli/xmake.lua b/xmake/rules/xmake_cli/xmake.lua new file mode 100644 index 000000000..25acf0568 --- /dev/null +++ b/xmake/rules/xmake_cli/xmake.lua @@ -0,0 +1,25 @@ +--!A cross-platform build utility based on Lua +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- +-- Copyright (C) 2015-2020, TBOOX Open Source Group. +-- +-- @author ruki +-- @file xmake.lua +-- + +-- define rule: xmake cli program +rule("xmake.cli") + before_load(function (target) + target:set("kind", "binary") + end) |
