-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CMake option to bundle all static dependencies
This PR adds a new bootstrap/cmake option for *nix operating systems that allows for creating a single unified static library that contains libtiledb and all the vcpkg installed dependencies.
- Loading branch information
Showing
3 changed files
with
66 additions
and
0 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
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,37 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import shlex | ||
import os.path | ||
import subprocess as sp | ||
|
||
VCPKG_DIR = "vcpkg_installed" | ||
|
||
def vcpkg_deps(): | ||
if not os.path.isdir(VCPKG_DIR): | ||
print("Unable to find `{VCPKG_DIR}` directory") | ||
exit(2) | ||
for entry in os.listdir(VCPKG_DIR): | ||
libdir = os.path.join(VCPKG_DIR, entry, "lib") | ||
print(libdir) | ||
if not os.path.isdir(libdir): | ||
continue | ||
for entry in os.listdir(libdir): | ||
if os.path.splitext(entry)[1] != ".a": | ||
continue | ||
yield os.path.join(libdir, entry) | ||
|
||
|
||
def main(): | ||
libs = ["tiledb/libtiledb.a"] | ||
libs.extend(vcpkg_deps()) | ||
for lib in libs: | ||
if not os.path.isfile(lib): | ||
print("Path failed: {}", lib) | ||
exit(2) | ||
|
||
cmd = "armerge --output libtiledb_bundled.a " + " ".join(libs) | ||
sp.check_call(cmd, shell=True) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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