Skip to content

Commit cfaf122

Browse files
committed
add snippet
1 parent 7d0774d commit cfaf122

File tree

4 files changed

+31
-0
lines changed

4 files changed

+31
-0
lines changed

snippet/TemporaryTest/main.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include <iostream>
2+
3+
4+
int main()
5+
{
6+
std::cout << __cplusplus << std::endl;
7+
8+
9+
return 0;
10+
}

snippet/TemporaryTest/xmake.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
target ("TemporaryTest")
2+
set_kind ("binary")
3+
add_files ("main.cpp")

snippet/xmake.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
-- Find all directories in the current list directory
2+
local dirs = os.dirs("*")
3+
4+
-- Iterate over directories and check if xmake.lua and .buildme exist
5+
for _, dir in ipairs (dirs) do
6+
local xmakeFile = path.join(dir, "xmake.lua")
7+
local buildmeFile = path.join(dir, ".buildme")
8+
9+
if os.isdir(dir) and os.isfile(xmakeFile) and os.isfile(buildmeFile) then
10+
-- Add subdirectory as a sub-project in xmake
11+
includes (dir)
12+
13+
end
14+
15+
end

xmake.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ target ("linux-kernel-module")
77
set_values ("linux.driver.linux-headers", "$(linux-headers)")
88

99
add_cflags ("-O1")
10+
11+
12+
includes ("snippet")

0 commit comments

Comments
 (0)