cannot import module in sub-directory #3812
Unanswered
MaxwellGengYF
asked this question in
Q&A
Replies: 2 comments
-
xmake.lua target("main")
set_kind("binary")
add_files("src/*.cpp")
before_build(function (target)
import("my_lib")
my_lib()
end) i-2:test6 ruki$ xmake
checking for Xcode directory ... /Applications/Xcode.app
checking for Codesign Identity of Xcode ... Apple Development: [email protected] (E44X6YUK5E)
checking for SDK version of Xcode for macosx (x86_64) ... 13.0
checking for Minimal target version of Xcode for macosx (x86_64) ... 12.6
hello <--------------
[ 25%]: cache compiling.release src/main.cpp
[ 50%]: linking.release main
[100%]: build ok, spent 1.173s $ cat my_lib.lua
function main()
print("hello")
end |
Beta Was this translation helpful? Give feedback.
0 replies
-
$ xmake
checking for Xcode directory ... /Applications/Xcode.app
checking for Codesign Identity of Xcode ... Apple Development: [email protected] (E44X6YUK5E)
checking for SDK version of Xcode for macosx (x86_64) ... 13.0
checking for Minimal target version of Xcode for macosx (x86_64) ... 12.6
hello
[ 25%]: cache compiling.release src/main.cpp
[ 50%]: linking.release test
hello <------------------
[100%]: build ok, spent 0.541s $ cat src/xmake.lua
target("test")
add_files("*.cpp")
after_build(function (target)
import(".my_lib")
my_lib()
end) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Xmake Version
2.7.9
Operating System Version and Architecture
Any platform
Describe Bug
with dir:
./my_lib.lua
./src/xmake.lua
code in any script-field in ./src/xmake.lua:
local my_lib = import("my_lib")
or:
local my_lib = import("../my_lib")
Neither can find my_lib successfully.
Expected Behavior
local my_lib = import("../my_lib")
should be available.
Project Configuration
No response
Additional Information and Error Logs
No response
Beta Was this translation helpful? Give feedback.
All reactions