From b0b0533227fb8d2d9d4ab676270618bf11cd64b4 Mon Sep 17 00:00:00 2001 From: Nicolas Hake Date: Sat, 7 Jan 2017 12:05:14 +0100 Subject: [PATCH] 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. --- CMakeLists.txt | 1 + src/script/C4ScriptMain.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e13d13ba..44c0e2aba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1143,6 +1143,7 @@ target_compile_definitions(c4script PRIVATE "USE_CONSOLE") target_link_libraries(c4script libmisc libc4script + ${GETOPT_LIBRARIES} ) if(NOT HEADLESS_ONLY) diff --git a/src/script/C4ScriptMain.cpp b/src/script/C4ScriptMain.cpp index f900fb8f0..3c3c7fe11 100644 --- a/src/script/C4ScriptMain.cpp +++ b/src/script/C4ScriptMain.cpp @@ -27,7 +27,7 @@ int usage(const char *argv0) return 1; } -int main(int argc, char *const argv[]) +int main(int argc, char *argv[]) { if (argc < 2) return usage(argv[0]);