-
Hello!
I have a simple project structure: shared library and an executable that's linking the library. On linux I prefer not to use "lib" prefix for library name, so I use target("xmake-test-lib")
set_kind("shared")
set_prefixname("")
add_files("lib.cpp")
target("xmake-test")
add_deps("xmake-test-lib")
set_kind("binary")
add_files("main.cpp")
#include "lib.h"
#include <iostream>
int main(int argc, char* argv[]) {
std::cout << getNumber() << std::endl;
return 0;
}
#pragma once
int getNumber();
#include "lib.h"
int getNumber() {
return 42;
} The output I get:
The output directory contains |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
xmake use target("foo")
set_kind("shared")
after_build(function (target)
os.cp(target:targetfile(), path.join(target:targetdir(), "foo.so"))
end) |
Beta Was this translation helpful? Give feedback.
-
Hey @waruqi , thank you for explanation and the suggestion!
I'd like to point out that there is a feature of
Described here: https://www.man7.org/linux/man-pages/man1/ld.1.html |
Beta Was this translation helpful? Give feedback.
I know about it, but it relies on a specific compiler and we need to deal with different compilers. But the implementation of dependent inheritance is currently a generic implementation, which would be complicated for us to change and not well maintained. So we won't consider supporting it for now.