{"id":21107475,"url":"https://github.com/cjhdev/sea_pool","last_synced_at":"2025-12-28T19:16:30.875Z","repository":{"id":240661500,"uuid":"758943447","full_name":"cjhdev/sea_pool","owner":"cjhdev","description":"A tool for combining many C and/or C++ files into one file","archived":false,"fork":false,"pushed_at":"2024-11-24T18:22:55.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-21T03:42:34.137Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cjhdev.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-02-17T14:34:38.000Z","updated_at":"2024-11-24T18:22:58.000Z","dependencies_parsed_at":"2024-05-20T12:32:08.704Z","dependency_job_id":"385316da-ef5e-4d2d-aaeb-b88eb70302fa","html_url":"https://github.com/cjhdev/sea_pool","commit_stats":null,"previous_names":["cjhdev/sea_pool"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjhdev%2Fsea_pool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjhdev%2Fsea_pool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjhdev%2Fsea_pool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cjhdev%2Fsea_pool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cjhdev","download_url":"https://codeload.github.com/cjhdev/sea_pool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243551431,"owners_count":20309343,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-11-20T00:40:07.406Z","updated_at":"2025-12-28T19:16:30.834Z","avatar_url":"https://github.com/cjhdev.png","language":"Ruby","readme":"SeaPool\n=======\n\nA tool for combining many C and/or C++ files into one file.\n\n~~~ ruby\nSeaPool.new do |a|\n\n    # these files will be combined into output\n    a.add_input 'src/input1.cpp'\n    a.add_input 'src/input2.cpp'\n    a.add_input 'src/sub/input3.cpp'\n    a.add_input 'src/input4.cpp', 'src/input5.cpp', 'src/input6.cpp'\n\n    # search for files here (e.g. #include \"some_file.cpp\")\n    a.add_include 'include'\n    a.add_include 'src'\n    a.add_include 'src/sub'\n    a.add_include 'src/another1', 'src/another2'\n\n    # search for system files here (e.g. #include \u003csome_file.h\u003e)\n    a.add_system_include '/opt/somearch/include'\n    a.add_system_include '/opt/somearch2/include', '/opt/somearch3/include'\n\n    # never expand these files\n    a.add_ignore 'include/to_be_ignored.h'\n    a.add_ignore 'include/another_to_be_ignored1.h', 'include/another_to_be_ignored2.h'\n\n    # the combined output file (can only be one file)\n    a.set_output 'combined.cpp'\n\n).run\n~~~\n\nOr, a shorter version of the same example in the terminal:\n\n~~~ bash\nbundle exec sea_pool --include=include --system=/opt/somearch/include --ignore=include/to_be_ignored.h --output=combined.cpp src/input1.cpp src/input2.cpp\n~~~\n\n## Features\n\n- expands `#include`\n    - `#include\"\"` if a file is found in the `include` search path\n    - `#include\u003c\u003e` if a file is found in the `system_include` search path\n- will not expand an `#include` if\n    - no match is found in the search path\n    - a match is found in the exclude list\n    - non-exluded match has already been expanded\n- comments out `#include` which have already been expanded (also a limitation)\n- inserts `#file` into output so that compile time messages can be referenced back to the original files\n- non-recursive and line based\n- depends only on Ruby stdlib (should work with your system Ruby)\n- available as standalone executable via bin/sea_pool_exporter\n\n## Limitations\n\n- does not evaluate include guards or `#pragma once`\n- does not support including same file multiple times (workaround for the above)\n- does not interpret preprocessor variables\n- input files must be written in a way that makes them suitable for amalgamation\n    - ensure no file static name collisions\n    - ensure no 'using namespace' in c++\n- it's a preprocessor, it won't check if your code can compile\n- lines that are not UTF-8 are passed through to output without any processing\n- doesn't consider if a file is a link\n\n## Exporting Standalone Executable\n\n~~~ bash\nbundle exec sea_pool_exporter \u003e your_executable_file\n~~~\n\nor\n\n~~~ bash\nbundle exec sea_pool_exporter --output=your_executable_file\n~~~\n\nThis file can be kept with your project.\n\n## The Future\n\n- might evaluate guards\n- might expand other macros\n- might fix file static name problems\n\n## Hints\n\n- Don't combine C and C++ into the same file unless you want to compile C with a C++ compiler\n- ensure file static preprocessor macros are `#undef` at end of a file\n\n## Why?\n\n- sometimes fewer source files can make a project easier to distribute\n- sometimes fewer source files will speed up compile time (Arduino + GNU tools ported to Windows!)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcjhdev%2Fsea_pool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcjhdev%2Fsea_pool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcjhdev%2Fsea_pool/lists"}