Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Clang flag #331

Closed
Konstantin8105 opened this issue Nov 7, 2017 · 2 comments
Closed

Add Clang flag #331

Konstantin8105 opened this issue Nov 7, 2017 · 2 comments

Comments

@Konstantin8105
Copy link
Contributor

Konstantin8105 commented Nov 7, 2017

Add clang flag for solve next.

Prototype:

Transpile both sqlite3 files in according https://sqlite.org/howtocompile.html

c2go transpile -o=sqlite3.go "-DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION shell.c sqlite3.c"

Trigraph sequences #303

c2go transpile -o=file.go "-trigraphs file.c"

Allow passing include directory to clang #196

Design in #196 is not good, let's use clang native design(without space)
c2go transpile -o=file.go "-I/path/to/include file.c"

Solution

  1. If user transpile many C file without specific clang flag, then design:
    c2go transpile file1.c file2.c file3.c

  2. If user transpile many C file with specific clang flag, then design:
    c2go transpile "-CLANG_FLAG file1.c file2.c file3.c" (Added " around file list)

Note:

  • In according to discussion Add support of 2 or more C source files. Fixes #63 #258 : if user not specify name of output file, then we can take at the base - first filename. For example : In case: "-CLANG_FLAG file1.c file2.c file3.c", First input file file1.c, so output will be file1.go.
@Konstantin8105
Copy link
Contributor Author

In according to #258, from @elliotchance :

Can you also update https://github.com/elliotchance/c2go/blob/master/travis/test.sh#L86-L89 so that we transpile both sqlite3 files with the same command.

@Konstantin8105 Konstantin8105 changed the title Compiler flag Add Clang flag Nov 7, 2017
@Konstantin8105
Copy link
Contributor Author

Design at the end look like that, for more detail see #337:

./c2go transpile -o=file.go  -clang-flag="-D_GNU_SOURCE" file.c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant