elliotchance / c2go

⚖️ A tool for transpiling C to Go.
MIT License
2.06k stars 151 forks source link

Need to include a directory for using c2go on a file #854

Open Crystal-Lilith opened 4 years ago

Crystal-Lilith commented 4 years ago

Hello, i am wondering if i am able to include a full directory with c2go, as i am turning a big C project into a go project for testing, and to do so, i need to be able to include my Include folder, any help appreciated

elliotchance commented 4 years ago

Hi @Crystal-Lilith, off the top of my head you have three options:

  1. Perform each file at a time, to produce one go file for each C input file. Something like find . -name "*.c" | xargs -n1 | c2go transpile
  2. Supply multiple input files. Something like c2go transpile $(find . -name "*.c")
  3. Use the clang preprocessor first (see here)