projects/generate
branchgamebalance
changeset 9913 e79cd19772dd
parent 6503 92d748cdefbe
child 6732 ca1b466db422
--- a/projects/generate	Wed Jun 13 12:05:56 2007 +0000
+++ b/projects/generate	Tue Jun 19 07:21:01 2007 +0000
@@ -31,12 +31,31 @@
 
 # First, collect the list of Windows files
 sdl_config="1"
+png_config="1"
 os="MSVC"
 enable_dedicated="0"
 with_cocoa="0"
 enable_directmusic="1"
 file_prefix="..\\\\src\\\\"
 
+safety_check() {
+	li=""
+	for i in `cat $1 | grep -v "#\|ottdres.rc\|win32.cpp\|win32_v.cpp" | xargs -n 1 basename | sort`; do
+		if [ "$li" = "$i" ]; then
+			echo " !! ERROR !!"
+			echo ""
+			echo "The filename '$i' is already used in this project."
+			echo "Because MSVC uses one single directory for all object files, it"
+			echo "cannot handle filenames with the same name inside the same project."
+			echo "Please rename either one of the file and try generating again."
+			echo ""
+			echo " !! ERROR !!"
+			exit 1
+		fi
+		li="$i"
+	done
+}
+
 load_main_data() {
 	# Read the source.list and process it
 	RES="`cat $1 | tr '\r' '\n' | awk '
@@ -52,6 +71,7 @@
 			deep += 1;
 
 			if ($0 == "SDL"         && "'$sdl_config'" == "")          { next; }
+			if ($0 == "PNG"         && "'$png_config'" == "")          { next; }
 			if ($0 == "OSX"         && "'$os'" != "OSX")               { next; }
 			if ($0 == "OS2"         && "'$os'" != "OS2")               { next; }
 			if ($0 == "PSP"         && "'$os'" != "PSP")               { next; }
@@ -167,6 +187,8 @@
 	' >> "$ROOT_DIR/projects/$2"
 }
 
+safety_check "$ROOT_DIR/source.list"
+
 load_main_data "$ROOT_DIR/source.list" openttd
 load_lang_data "$ROOT_DIR/src/lang/*.txt" lang