summaryrefslogtreecommitdiff
path: root/projects/generate
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2007-06-17 20:14:38 +0000
committertruelight <truelight@openttd.org>2007-06-17 20:14:38 +0000
commit8c3e9d111f55531f67e8dc132c678d70632f56d9 (patch)
tree0cfc0221812b78d8356689c83b98f10d8c5a13f5 /projects/generate
parentc016eca97f8acbe95502404ff19c5644afb1b2ae (diff)
downloadopenttd-8c3e9d111f55531f67e8dc132c678d70632f56d9.tar.xz
(svn r10189) -Add: added a safety check in MSVC project generate script to make sure we do not use filenames with the same name in different directories, as MSVC is plain stupid and can't handle that (go wine to Billy or something if you want it fixed properly)
Diffstat (limited to 'projects/generate')
-rwxr-xr-xprojects/generate20
1 files changed, 20 insertions, 0 deletions
diff --git a/projects/generate b/projects/generate
index c40cd8d5b..e218d9634 100755
--- a/projects/generate
+++ b/projects/generate
@@ -38,6 +38,24 @@ with_cocoa="0"
enable_directmusic="1"
file_prefix="..\\\\src\\\\"
+safety_check() {
+ li=""
+ for i in `cat $1 | grep -v "#" | 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 '
@@ -169,6 +187,8 @@ generate() {
' >> "$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