Make c4script binary use our private getopt library if necessary

Systems that don't come with getopt/getopt_long in their runtime library
need to link to our private copy; link that and use the right const-ness
for its prototype.
alut-include-path
Nicolas Hake 2017-01-07 12:05:14 +01:00
parent eeea131674
commit b0b0533227
2 changed files with 2 additions and 1 deletions

View File

@ -1143,6 +1143,7 @@ target_compile_definitions(c4script PRIVATE "USE_CONSOLE")
target_link_libraries(c4script target_link_libraries(c4script
libmisc libmisc
libc4script libc4script
${GETOPT_LIBRARIES}
) )
if(NOT HEADLESS_ONLY) if(NOT HEADLESS_ONLY)

View File

@ -27,7 +27,7 @@ int usage(const char *argv0)
return 1; return 1;
} }
int main(int argc, char *const argv[]) int main(int argc, char *argv[])
{ {
if (argc < 2) if (argc < 2)
return usage(argv[0]); return usage(argv[0]);