{"id":45324404,"url":"https://github.com/libpag/vendor_tools","last_synced_at":"2026-02-21T08:30:23.831Z","repository":{"id":41891007,"uuid":"446641234","full_name":"libpag/vendor_tools","owner":"libpag","description":"Tools for building vendor libraries.","archived":false,"fork":false,"pushed_at":"2025-10-24T09:10:21.000Z","size":457,"stargazers_count":6,"open_issues_count":1,"forks_count":7,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-24T11:18:16.335Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/libpag.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-01-11T01:44:45.000Z","updated_at":"2025-10-24T09:10:25.000Z","dependencies_parsed_at":"2024-12-06T05:22:30.411Z","dependency_job_id":"fdb959d2-93fd-46d6-aaf7-f28257fbdd84","html_url":"https://github.com/libpag/vendor_tools","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/libpag/vendor_tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libpag%2Fvendor_tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libpag%2Fvendor_tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libpag%2Fvendor_tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libpag%2Fvendor_tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/libpag","download_url":"https://codeload.github.com/libpag/vendor_tools/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libpag%2Fvendor_tools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29677491,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T06:23:40.028Z","status":"ssl_error","status_checked_at":"2026-02-21T06:23:39.222Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-21T08:30:23.176Z","updated_at":"2026-02-21T08:30:23.825Z","avatar_url":"https://github.com/libpag.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Introduction\nA set of tools for building vendor libraries using Node.js, providing a consistent way to build libraries across all \nplatforms. Initially developed as built-in tools for the [libpag](https://github.com/Tencent/libpag) project, it has \nbeen extracted as a standalone project to offer a more flexible and reusable solution for building vendor libraries. \nDesigned to work with CMake projects, it provides command-line tools to build vendor libraries defined in a `vendor.json`\nfile and cache the build results. The toolset supports building libraries on `Windows`, `macOS`, `iOS`, `Android`, \n`Linux`, `Web`, and `HarmonyOS`.\n\n## Configuration\n\nThe `vendor.json` file is used to define the vendor libraries to be built. Here is an example:\n\n```json\n{\n  \"source\": \"third_party\",\n  \"out\": \"third_party/out\",\n  \"vendors\": [\n    {\n      \"name\": \"zlib\",\n      \"cmake\": {\n        \"targets\": [\n          \"zlibstatic\"\n        ],\n        \"includes\": [\n          \"${SOURCE_DIR}/zlib.h\",\n          \"${BUILD_DIR}/zconf.h\"\n        ]\n      }\n    },\n    {\n      \"name\": \"libpng\",\n      \"deps\": {\n        \"ZLIB\": \"zlib\"\n      },\n      \"cmake\": {\n        \"targets\": [\n          \"png_static\"\n        ],\n        \"arguments\": [\n          \"-DPNG_BUILD_ZLIB=ON\"\n        ],\n        \"includes\": [\n          \"${SOURCE_DIR}/png.h\",\n          \"${SOURCE_DIR}/pngconf.h\",\n          \"${BUILD_DIR}/pnglibconf.h\"\n        ],\n        \"platforms\": [\n          \"android\",\n          \"win\",\n          \"linux\"\n        ]\n      }\n    },\n    {\n      \"name\": \"libpng\",\n      \"deps\": {\n        \"ZLIB\": \"zlib\"\n      },\n      \"cmake\": {\n        \"targets\": [\n          \"png_static\"\n        ],\n        \"arguments\": [\n          \"-DPNG_BUILD_ZLIB=ON\",\n          \"-DPNG_ARM_NEON=on\"\n        ],\n        \"includes\": [\n          \"${SOURCE_DIR}/png.h\",\n          \"${SOURCE_DIR}/pngconf.h\",\n          \"${BUILD_DIR}/pnglibconf.h\"\n        ],\n        \"platforms\": [\n          \"ios\",\n          \"mac\"\n        ]\n      }\n    },\n    {\n      \"name\": \"sonic\",\n      \"scripts\": {\n        \"mac\": {\n          \"executor\": \"bash\",\n          \"file\": \"scripts/sonic/build_mac.sh\"\n        },\n        \"win\": {\n          \"executor\": \"bash\",\n          \"file\": \"scripts/sonic/build_win.sh\"\n        }\n      }\n    }\n  ]\n}\n```\n\nFor more examples, check out the [vendor.json](https://github.com/Tencent/tgfx/blob/main/vendor.json) file in the tgfx project.\n\n## Command Line Tools\n\n### vendor-build\n\nUsed to build vendor libraries defined in `vendor.json` and cache the build results. It automatically detects changes in \n`vendor.json` and rebuilds as needed.\n\n#### Syntax:   \n```sh\nnode vendor-build [vendorName] [vendorName]... [Options]\n```\n\n#### Options\n- `--source`, `-s`: Specify the source path of `vendor.json`. Default is the current working directory.\n- `--platform`, `-p`: Specify the current platform. Supported platforms: `[\"win\", \"mac\", \"ios\", \"linux\", \"android\", \"web\", \"ohos\"]`.\n- `--arch`, `-a`: Build only for the specified architecture. Supported architectures: `[\"x86\", \"x64\", \"arm\", \"arm64\", \"arm64-simulator\", \"wasm\", \"wasm-mt\"]`.\n- `--output`, `-o`: Publish all vendor libraries to the specified output directory. All shared libraries will be copied, and all static libraries will be merged.\n- `--xcframework`, `-x`: If the current platform supports it, merge all architectures of the library into one `xcframework`. Ignored if `--output` is not specified.\n- `--debug`, `-d`: Enable debug mode build.\n- `--verbose`, `-v`: Print messages in verbose mode.\n- `--help`, `-h`: Print help information.\n\n#### Examples\n```sh\nnode vendor-build libpng libwebp\nnode vendor-build --debug\nnode vendor-build -p mac -a arm64 --verbose\n```\n\n### cmake-build\n\nUsed to build CMake projects consistently across all platforms, including Windows, macOS, iOS, Android, Linux, Web, and \nHarmonyOS.\n\n#### Syntax:   \n```sh\nnode cmake-build  [cmakeTarget] [cmakeTarget]... [Options] [-Dcmake_variable=value]... [-Dcmake_variable=value]\n```\n\n#### Options\n- `--source`, `-s`: Specify the source path of `CMakeLists.txt`. Default is the current working directory.\n- `--output`, `-o`: Specifies the output path. Default is [source]/out.\n- `--platform`, `-p`: Specify the current platform. Supported platforms: `[\"win\", \"mac\", \"ios\", \"linux\", \"android\", \"web\", \"ohos\"]`.\n- `--arch`, `-a`: Build only for the specified architecture. Supported architectures: `[\"x86\", \"x64\", \"arm\", \"arm64\", \"arm64-simulator\", \"wasm\", \"wasm-mt\"]`.\n- `--incremental`, `-i`: Uses incremental build. The build directory will not be removed after the building finished.\n- `--native`, `-n`: Use the native generator with cmake to build the library if the current platform supports it.\n- `--debug`, `-d`: Builds with debug mode enabled.\n- `--symbols`, `-S`: Generate the debug symbols. Default is true if --debug is specified.\n- `--verbose`, `-v`: Print messages in verbose mode.\n- `--help`, `-h`: Print help information.\n  \nYou can also pass any other cmake variables with a `-D` prefix to `cmake-build`, and they will be forwarded to the `cmake` command.\n\n#### Examples\n```sh\nnode cmake-build pag -p ios -o ./out/ios\nnode cmake-build pag pag-staic --debug\nnode cmake-build pag -DTGFX_USE_WEBP_ENCODE=ON -p mac --verbose\n```\n\n### lib-build\n\nIt wraps `cmake-build` to build CMake projects with a caching mechanism. It automatically detects changes in the source \nfiles and rebuilds the project if necessary.\n\n#### Syntax:   \n```sh\nnode lib-build [cmakeTarget] [Options] [-Dcmake_variable=value]... [-Dcmake_variable=value]\n```\n\n#### Options\n- `--source`, `-s`: Specify the source path of `CMakeLists.txt`. Default is the current working directory.\n- `--output`, `-o`: Specifies the output path. Default is [source]/out.\n- `--platform`, `-p`: Specify the current platform. Supported platforms: `[\"win\", \"mac\", \"ios\", \"linux\", \"android\", \"web\", \"ohos\"]`.\n- `--arch`, `-a`: Build only for the specified architecture. Supported architectures: `[\"x86\", \"x64\", \"arm\", \"arm64\", \"arm64-simulator\", \"wasm\", \"wasm-mt\"]`.\n- `--incremental`, `-i`: Uses incremental build. The build directory will not be removed after the building finished.\n- `--native`, `-n`: Use the native generator with cmake to build the library if the current platform supports it.\n- `--xcframework`, `-x`: Merges all arches of the output libraries into one `xcframework` if the current platform supports it.\n- `--debug`, `-d`: Builds with debug mode enabled.\n- `--help`, `-h`: Print help information.\n\nYou can also pass any other cmake variables with a `-D` prefix to `lib-build`, and they will be forwarded to the `cmake` command.\nBy default, debug symbols will be stripped unless the `--debug` flag is specified.\n\n#### Examples\n```sh\nnode lib-build pag -p ios -o ./out/ios\nnode lib-build pag --debug\nnode lib-build pag -DTGFX_USE_WEBP_ENCODE=ON -p mac\n```\n\n### lib-merge\n\nUsed to merge static libraries into a single library without worrying about the platform-specific commands.\n\n#### Syntax:   \n```sh\nnode lib-merge [libraryName] [libraryName]... [Options]\n```\n\n\n#### Options\n- `--platform`, `-p`: Specifies the current platform. Supported platforms: `[\"win\", \"mac\", \"ios\", \"linux\", \"android\", \"web\", \"ohos\"]`.\n- `--xcframework`, `-x`: Merges all archs in the specified library path into one `xcframework` if the current platform supports it.\n- `--arch`, `-a`: Specifies the arch of the current platform. Supported archs: `[\"x86\", \"x64\", \"arm\", \"arm64\", \"arm64-simulator\", \"wasm\", \"wasm-mt\"]`. Ignored if `--xcframework` is specified.\n- `--output`, `-o`: Merges all static libraries into the specified output library file.\n- `--verbose`, `-v`: Prints messages in verbose mode.\n- `--help`, `-h`: Prints help information.\n\n#### Examples\n```sh\nnode lib-merge libpng.a libwebp.a -o libvendor.a -p mac -a x64\nnode lib-merge -x vendor/ffavc -p mac -o out/ffavc\n```\n\n### xcode-gen\n\nUsed to generate Xcode projects for CMake projects.\n\n#### Syntax:   \n```sh\nnode xcode-gen sourcePath [options] [-Dcmake_variable=value]... [-Dcmake_variable=value]\n```\n\n#### Options\n- `--source`, `-s`: Specify the root of the cmake project. Default is the current working directory.\n- `--output`, `-o`: Specify the output path of the generated project. Default is the current working directory.\n- `--platform`, `-p`: Specify the platform to generate. Supported platforms: `[\"mac\", \"ios\", \"simulator\"]`.\n- `--arch`, `-a`: Specify the arch of the generated project. Supported arches: `[\"x64\", \"arm64\"]`.\n- `--workspace`, `-w`: Generate an additional *.xcworkspace for the existing xcode project in the output directory.\n- `--help`, `-h`: Print help message.\n\nYou can also pass any other cmake variables with a `-D` prefix to `xcode-gen`, and they will be forwarded to the `cmake` command.\n\n#### Examples\n```sh\nnode xcode-gen  ./source -p mac -DTGFX_USE_WEBP_ENCODE=ON\nnode xcode-gen  ./source -p simulator -a arm64\nnode xcode-gen  ./source -p ios -a arm64 -w\n```\n\n### ms-build\n\nUsed to build Visual Studio projects, this tool automatically detects the location of the Visual Studio installation.\n\n#### Syntax:   \n```sh\nnode ms-build [-a x86|x64] [msbuild options]\n```\n\n#### Options\n- `--arch`, `-a`: Specify the arch of the Command Prompt for VS. Supported archs: `[\"x86\", \"x64\"]`. Default is x64.\n- `--help`, `-h`: Print help message.\n \nAny other options will be passed to `msbuild`.\n\n#### Examples\n```sh\nnode ms-build -a x64 win/Win32Demo.sln /p:Configuration=Release /p:Platform=x64\n```\n\n## CMake Integration\n\nThe `vendor.cmake` file in the root directory includes a set of CMake functions to help build vendor libraries. It also\nautomatically runs the `depsync` tool to download dependencies during the build process.\n\nYou can include it in your CMake project like this:\n\n```cmake\ninclude(vendor_tools/vendor.cmake)\n```\n\nThen, use the functions `add_vendor_target`, `merge_libraries_into`, and `find_vendor_libraries` from `vendor.cmake` to \nbuild your vendor libraries. For more examples, check out the [CMakeLists.txt](https://github.com/Tencent/tgfx/blob/main/CMakeLists.txt) \nfile in the tgfx project.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibpag%2Fvendor_tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibpag%2Fvendor_tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibpag%2Fvendor_tools/lists"}