-
-
Notifications
You must be signed in to change notification settings - Fork 764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Package based on xmake doesn't work when changing output naming #5252
Comments
I'm curious, which compiler are you using? You said you use MSVC but MSVC doesn't have a prefix and already uses .lib extension. As for this issue, xmake searches library based on the toolchain know lib extension, I think the best here is not to make a custom package but to make a custom toolchain (if msvc doesn't suit you) |
I'm targetting the GDK, and I use a custom platform name with the |
This is how I do the -- This is in my project
set_allowedplats(
"gdk", "gdkx", "xbox360", "windows",
"linux",
"switch", "switchhb"
)
set_allowedarchs(
"gdk|x64", "gdkx|x64", "xbox360|powerpc64", "windows|x86",
"switch|arm64", "switchhb|arm64"
)
-- This is in a separate lua file that gets included and then called in a function I use for on_load
function fix_name(target)
if is_plat("gdk", "gdkx", "xbox360") then
target:set("prefixname", "")
if target:kind() == "binary" then
target:set("extension", ".exe")
elseif target:kind() == "static" then
target:set("extension", ".lib")
elseif target:kind() == "shared" then
target:set("extension", ".dll")
end
elseif is_plat("switch") then
if target:kind() == "binary" then
target:set("prefixname", "")
target:set("extension", ".nss")
elseif target:kind() == "static" then
target:set("prefixname", "lib")
target:set("extension", ".a")
elseif target:kind() == "shared" then
target:set("prefixname", "lib")
target:set("extension", ".nrs")
end
elseif is_plat("switchhb", "psp", "ps3") then
if target:kind() == "binary" then
target:set("prefixname", "")
target:set("extension", ".elf")
elseif target:kind() == "static" then
target:set("prefixname", "lib")
target:set("extension", ".a")
elseif target:kind() == "shared" then
target:set("prefixname", "lib")
target:set("extension", ".elf")
end
end
end I also have a similar |
The cross platform is only for cross-compilation toolchain, but msvc is not. If you still use msvc, please use windows platform. And package only supports some builtin platforms now. You can define a custom option to set your custom platform. e.g. |
Xmake Version
v2.9.2+master.38c2ebc6f
Operating System Version and Architecture
Windows 10.0.19045.4529 Pro 22H2
Describe Bug
In my project, I use custom platforms which use MSVC, meaning the names have to follow the exact convention or they don't work. I get around this by setting the prefix and extension like this:
If the two lines there aren't commented out, when I build the package, no libraries are detected, and using
add_packages
only finds header files, even though the library output is still copied.Expected Behavior
When I change the extension of a target used in a package, it should still be detected as a library and included in the list for the package, so I can link to it.
Project Configuration
Additional Information and Error Logs
With the default cross name:
With the custom name:
The text was updated successfully, but these errors were encountered: