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 ability to run any source file through a command line option #25

Open
Ok23 opened this issue Sep 9, 2021 · 4 comments
Open

Add ability to run any source file through a command line option #25

Ok23 opened this issue Sep 9, 2021 · 4 comments

Comments

@Ok23
Copy link

Ok23 commented Sep 9, 2021

No description provided.

@anael-seghezzi
Copy link
Owner

Yes why not, it should be easy to add. Let's think about the syntax.

@Ok23
Copy link
Author

Ok23 commented Sep 11, 2021

I do not think that there is a lot of space for a variety. If there is no second path argument, look for source in CToy application path src/main.c

@Ok23
Copy link
Author

Ok23 commented Sep 11, 2021

Maybe add optional arguments such as --inc for includes, --lib for static libs

@anael-seghezzi
Copy link
Owner

So, after thinking about it, using the command line to run any source is not an option because:
1: It will break compatibility of previous projects already using "ctoy_argc" and "ctoy_argv".
2: It will break the ability to compile with other compiler (gcc etc) with "tool/build_native" and CMake.
Because the CMake script will have no way to know which c files to compile.

The only option I see would be to add a "CMakeLists.txt" file to "src/" and parse it.
The default CMakeLists.txt would be FILE(GLOB SOURCES main.c) and could be modified.

If parsing a basic FILE(GLOB SOURCES is not too hard, handling the complete syntax (recursion, *, etc) is not as simple.

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

No branches or pull requests

2 participants