-
I have a project structured like this:
And I notice that this can be solved by change this line from local argv = {"lua", "private.utils.bin2c", "-i", path(sourcefile_bin), "-o", path(headerfile)} into local argv = {"lua", "private.utils.bin2c", "-i", path.absolute(sourcefile_bin), "-o", path.absolute(headerfile)} But I also find that almost every generator comes with |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
It works for me. you can try https://github.com/xmake-io/xmake/blob/master/tests/projects/other/bin2c/ ruki-2:bin2c ruki$ xmake -rv
[ 50%]: generating.bin2c src/data.bin
/Users/ruki/.local/bin/xmake lua private.utils.bin2c -i src/data.bin -o build/.gens/test/macosx/x86_64/release/rules/utils/bin2c/data.bin.h -w 16
[ 50%]: generating.bin2c src/image.png
/Users/ruki/.local/bin/xmake lua private.utils.bin2c -i src/image.png -o build/.gens/test/macosx/x86_64/release/rules/utils/bin2c/image.png.h -w 16
generating code data file from /Users/ruki/projects/personal/xmake/tests/projects/other/bin2c/src/data.bin ..
generating code data file from /Users/ruki/projects/personal/xmake/tests/projects/other/bin2c/src/image.png ..
/Users/ruki/projects/personal/xmake/tests/projects/other/bin2c/build/.gens/test/macosx/x86_64/release/rules/utils/bin2c/image.png.h generated!
/Users/ruki/projects/personal/xmake/tests/projects/other/bin2c/build/.gens/test/macosx/x86_64/release/rules/utils/bin2c/data.bin.h generated!
[ 70%]: cache compiling.release src/main.c
"/usr/bin/xcrun -sdk macosx clang" -c -Qunused-arguments -target x86_64-apple-macos11.4 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX
.platform/Developer/SDKs/MacOSX11.3.sdk -fvisibility=hidden -O3 -Ibuild/.gens/test/macosx/x86_64/release/rules/utils/bin2c -DNDEBUG -o build/.objs/test/macos
x/x86_64/release/src/main.c.o src/main.c
[ 80%]: linking.release test
"/usr/bin/xcrun -sdk macosx clang++" -o build/macosx/x86_64/release/test build/.objs/test/macosx/x86_64/release/src/main.c.o -target x86_64-apple-macos11.4 -
isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk -stdlib=libc++ -Wl,-x -lz
[100%]: build ok!
ruki-2:bin2c ruki$ then please add |
Beta Was this translation helpful? Give feedback.
-
the project: Logs:
|
Beta Was this translation helpful? Give feedback.
-
xmake will find the top-level xmake.lua directory as the root, even though you have set Therefore, I do not recommend using root/xmake.lua includes("demo") root/demo/xmake.lua (remove includes) |
Beta Was this translation helpful? Give feedback.
xmake will find the top-level xmake.lua directory as the root, even though you have set
-P .
to force the current path to be the root of the project. However, thexmake lua
subprocess will still look for the root xmake.lua, so passing relative paths will be a problem.Therefore, I do not recommend using
includes("...")
to reverse include the root xmake.lua, which can cause a …