Timeline for Is possible to use script for dependencies in c++?
Current License: CC BY-SA 4.0
19 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Aug 10, 2020 at 21:14 | vote | accept | milanHrabos | ||
| Aug 10, 2020 at 18:39 | answer | added | Håkon Hægland | timeline score: 3 | |
| Aug 4, 2020 at 23:29 | comment | added | Loki Astari |
> g++ -MMD -MP -MF <FileName>.d <FileName>.cpp; cat <FileName>.d Normally you do this by adding appropriate definitions to your make file.
|
|
| Aug 4, 2020 at 22:37 | comment | added | Loki Astari |
you can get the make tool to do some of this work.
|
|
| Aug 4, 2020 at 18:21 | comment | added | Peter |
I still don't understand why you aren't using cmake or make. Perhaps you can clean up the question to make it easier to comprehend your end goal.
|
|
| Aug 4, 2020 at 17:23 | history | edited | milanHrabos | CC BY-SA 4.0 |
added 208 characters in body
|
| Aug 4, 2020 at 17:15 | comment | added | milanHrabos |
@vnp well some could but I do not know about one. It just get annoyed to always type the directory where the implementation is defined (If it wasn't in my current one). So i made a script where I can just pass a target from which the script would find those dependencies and include them to final command. It is not that "advanced", but does the job I want -> I can just simply directory to look at for any target files (that needs dependency - extern implementation), that's all it does
|
|
| Aug 4, 2020 at 17:12 | history | edited | milanHrabos | CC BY-SA 4.0 |
Added and example of usage
|
| Aug 4, 2020 at 16:23 | comment | added | vnp | The modern compilers have a capability to generate dependencies for you. I would rather trust this job to the compiler. | |
| Aug 4, 2020 at 13:18 | comment | added | milanHrabos |
@cmake or make does not have the capability of regular language - things like array, hashes and regexes come in hand in my solution. I have added help message althought not that verbose. By adding feature of -i target/dir makes it more general to specify for any source/header, which has dependecy in it. You can try it now
|
|
| Aug 4, 2020 at 13:14 | history | edited | milanHrabos | CC BY-SA 4.0 |
added help message
|
| Aug 4, 2020 at 9:44 | comment | added | Håkon Hægland |
Also specify why you did not use cmake or make instead of rolling your own solution
|
|
| Aug 4, 2020 at 9:42 | comment | added | Håkon Hægland |
Note that if you have #include "dir1/bar.hpp" in main.cpp the location of the file bar.hpp does not have to be in a subdirectory dir1 in the directory of main.cpp. For example it can be in a directory /path2/dir1/bar.hpp (provided you compile main.cpp with g++ -I/path2 ... main.cpp
|
|
| Aug 4, 2020 at 8:51 | comment | added | Håkon Hægland |
a.pl -i path/to/dependencies/cpp main does the program assume that the main.cpp and a.pl must be in the same directory? I.e., is it possible to call the program like this: a.pl -i path/to/dependencies/cpp path2/main ?
|
|
| Aug 4, 2020 at 8:41 | comment | added | Håkon Hægland | Please provide a description of how the different command line options should work. | |
| Aug 4, 2020 at 4:11 | comment | added | Mast♦ | "Could it always work" that's a dangerous question, but I assume you've tested it at least on your own system and that it works there? | |
| Aug 4, 2020 at 3:00 | history | tweeted | twitter.com/StackCodeReview/status/1290482745899008001 | ||
| Aug 3, 2020 at 22:45 | review | First posts | |||
| Aug 3, 2020 at 23:06 | |||||
| Aug 3, 2020 at 22:43 | history | asked | milanHrabos | CC BY-SA 4.0 |