-
Notifications
You must be signed in to change notification settings - Fork 99
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
Cannot link C main #643
Comments
How about faking that with:
/*
program my_c_program
*/
in the main.c source file?
Horrible hack, but it might work for now :).
Op ma 3 jan. 2022 om 16:03 schreef Sebastian Ehlert <
***@***.***>:
… I'm currently trying to (ab)use fpm to compile a C project. It is not a C
package manager, but it certainly could become one.
Using a project with the following layout:
fpm.toml
app/main.c
fpm.toml:
name = "test"
[[executable]]
name = "test"
main = "main.c"
app/main.c:
int
main (void) {
return 0;
}
Will fail to link the C executable with
❯ fpm build
+ mkdir -p build/gfortran_2A42023B310FA28D/test
+ gcc -c app/main.c -I./include -o build/gfortran_2A42023B310FA28D/test/app_main.c.o
❯ fpm run
<INFO> No executables to run
STOP 0
I think the source scanning must find a program statement in the
source-file declared as main in the manifest. Instead, it would be
preferable if fpm just trust the user input and assumes that the provided
main is providing the necessary entry point.
------------------------------
Tested with fpm 0.5.0
—
Reply to this email directly, view it on GitHub
<#643>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN6YR42SDJMIPHEAJMW6JDUUG3EHANCNFSM5LFM45JA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Fpm won't scan C source code for Fortran keywords, therefore it is not able to detect the program statement in the block comment. |
It is being too smart ;). Or I am too wrapped up in today's debugging
session to think of such an obvious obstacle.
Op ma 3 jan. 2022 om 16:29 schreef Sebastian Ehlert <
***@***.***>:
… Fpm won't scan C source code for Fortran keywords, therefore it is not
able to detect the program statement in the block comment.
—
Reply to this email directly, view it on GitHub
<#643 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN6YR7DG4WVRQHC56MO6BTUUG6D5ANCNFSM5LFM45JA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID:
***@***.***>
|
The issue originates in Line 30 in d99ad59
can add an executable by setting the Lines 34 to 36 in d99ad59
the |
I'm currently trying to (ab)use fpm to compile a C project. It is not a C package manager, but it certainly could become one.
Using a project with the following layout:
fpm.toml
:app/main.c
:Will fail to link the C executable with
I think the source scanning must find a
program
statement in the source-file declared asmain
in the manifest. Instead, it would be preferable if fpm just trust the user input and assumes that the providedmain
is providing the necessary entry point.Tested with fpm 0.5.0
The text was updated successfully, but these errors were encountered: