-
-
Notifications
You must be signed in to change notification settings - Fork 818
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5335 from xmake-io/install
Improve installation
- Loading branch information
Showing
35 changed files
with
1,187 additions
and
912 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Xmake cache | ||
.xmake/ | ||
build/ | ||
|
||
# MacOS Cache | ||
.DS_Store | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#include "foo.h" | ||
|
||
int add(int a, int b) { | ||
return a + b; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#if defined(_WIN32) | ||
# define __export __declspec(dllexport) | ||
#elif defined(__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) | ||
# define __export __attribute__((visibility("default"))) | ||
#else | ||
# define __export | ||
#endif | ||
|
||
__export int add(int a, int b); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include "foo.h" | ||
#include <iostream> | ||
|
||
int main(int argc, char** argv) { | ||
std::cout << "add(1, 2) = " << add(1, 2) << std::endl; | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
function main(t) | ||
if is_host("windows", "linux", "macosx") and os.arch():startswith("x") then | ||
os.vrun("xmake -y") | ||
os.vrun("xmake run app") | ||
os.vrun("xmake install -o build/usr") | ||
if not is_host("linux") then -- TODO, change rpath has been not supported yet on linux. | ||
os.vrun("./build/usr/app/bin/app" .. (is_host("windows") and ".exe" or "")) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
add_rules("mode.debug", "mode.release") | ||
|
||
set_version("1.0.1", {soname = true}) | ||
|
||
add_requires("libzip", {system = false, configs = {shared = true}}) | ||
|
||
target("foo") | ||
set_kind("shared") | ||
add_files("src/foo.cpp") | ||
add_packages("libzip", {public = true}) | ||
add_headerfiles("src/foo.h", {public = true}) | ||
add_installfiles("src/foo.txt", {prefixdir = "assets", public = true}) | ||
set_prefixdir("/", {libdir = "foo_lib"}) | ||
|
||
target("app") | ||
set_kind("binary") | ||
add_deps("foo") | ||
add_files("src/main.cpp") | ||
set_prefixdir("app", {libdir = "app_lib"}) | ||
add_rpathdirs("@loader_path/../app_lib", {installonly = true}) | ||
|
||
includes("@builtin/xpack") | ||
|
||
xpack("test") | ||
add_targets("app") | ||
set_formats("zip") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.