Compare commits

..

6 Commits

Author SHA1 Message Date
Nakidai 06f05e7412
Version 1.2 2024-03-07 00:37:15 +03:00
Nakidai cd0649a375
Return MinGW to tested 2024-03-07 00:33:17 +03:00
Nakidai 351c45b1c1
It's 2024 2024-03-07 00:32:37 +03:00
Nakidai a735950c67
Move config.mk to include/ 2024-03-07 00:31:36 +03:00
Nakidai ad871be017
Some work with templates
- Now configure script also reads templates (files which end by .in)
  - So added template for config.mk
- Moved templates to templates/ folder
2024-03-07 00:27:37 +03:00
Nakidai 8c6395592d
Merge branch 'fix-mingw' 2024-03-07 00:17:20 +03:00
8 changed files with 15 additions and 15 deletions

2
.gitignore vendored
View File

@ -3,4 +3,4 @@ build/
csnake
*.core
include/config.h
config.mk
include/config.mk

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.5)
project(csnake VERSION 1.1 LANGUAGES C)
project(csnake VERSION 1.2 LANGUAGES C)
if(PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
message(FATAL_ERROR "In-source builds are not allowed.")
@ -32,4 +32,7 @@ set(DEFX 0 CACHE STRING "Start x")
set(DEFY 0 CACHE STRING "Start y")
set(SLEEP 1000 CACHE STRING "Sleep between frames (ms)")
configure_file(include/config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/include/config.h)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/templates/config.h.in
${CMAKE_CURRENT_SOURCE_DIR}/include/config.h
)

View File

@ -1,4 +1,4 @@
Copyright 2023 nakidai
Copyright 2024 nakidai
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

View File

@ -1,4 +1,4 @@
include config.mk
include include/config.mk
INCLUDE = -Iinclude
RM = rm -f

View File

@ -10,7 +10,7 @@ Supported platforms
--
Was tested on:
- FreeBSD 13.2
- Windows 11 (MSVC)
- Windows 11 (both MSVC and MinGW)
- Linux 6.5.8 (glibc 2.38-7)
Building

11
configure vendored
View File

@ -45,12 +45,5 @@ echo "Start x: $DEFX"
echo "Start y: $DEFY"
echo "Sleep: $SLEEP"
echo "CC = $CC
CFLAGS = $CFLAGS
LDFLAGS = $LDFLAGS
OUT = $OUT" > config.mk
echo "#define FIELD_SIZE $FIELD_SIZE
#define DEFX $DEFX
#define DEFY $DEFY
#define SLEEP $SLEEP" > include/config.h
eval "echo \"$(cat templates/config.mk.in)\"" > include/config.mk
eval "echo \"$(cat templates/config.h.in)\"" > include/config.h

4
templates/config.mk.in Normal file
View File

@ -0,0 +1,4 @@
CC = ${CC}
CFLAGS = ${CFLAGS}
LDFLAGS = ${LDFLAGS}
OUT = ${OUT}