forked from nakidai/csnake
1
0
Fork 0

Change way to handle arguments in configure

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
)
set_target_properties(csnake PROPERTIES C_STANDARD 99)
set_target_properties(csnake PROPERTIES C_STANDARD 11)
set_target_properties(csnake PROPERTIES C_EXTENSIONS FALSE)
target_include_directories(csnake PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include)

16
configure vendored
View File

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