Change way to handle arguments in configure

fix-mingw
Nakidai 2023-11-25 20:27:09 +03:00
parent 49bd6ee329
commit cf8fe181a2
2 changed files with 14 additions and 4 deletions

View File

@ -14,7 +14,7 @@ add_executable(csnake
src/sleep.c src/sleep.c
) )
set_target_properties(csnake PROPERTIES C_STANDARD 99) set_target_properties(csnake PROPERTIES C_STANDARD 11)
set_target_properties(csnake PROPERTIES C_EXTENSIONS FALSE) set_target_properties(csnake PROPERTIES C_EXTENSIONS FALSE)
target_include_directories(csnake PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include) target_include_directories(csnake PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include)

16
configure vendored
View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
if [[ "$*" == *"--help"* ]] || [[ "$*" == *"-h"* ]] usage()
then {
echo "Use environment variables to pass values: echo "Use environment variables to pass values:
CC - compiler (default: cc) CC - compiler (default: cc)
CFLAGS - flags for compiler CFLAGS - flags for compiler
@ -11,7 +11,17 @@ then
DEFX - start x DEFX - start x
DEFY - start y" DEFY - start y"
exit 1 exit 1
fi }
while test $# -gt 0; do
case "$1" in
-h) usage
;;
--help) usage
;;
esac
shift
done
CC=${CC:-cc} CC=${CC:-cc}
CFLAGS=${CFLAGS:-} CFLAGS=${CFLAGS:-}