Kaynağa Gözat

[msvc] Automatically update (win-)config.h with the correct version number

A small powershell command grabs the version number from configure.ac and uses it during winsetup.bat,
this way we don't have to manually keep them in sync.
Alexander Köplinger 10 yıl önce
ebeveyn
işleme
361691c2a6
2 değiştirilmiş dosya ile 2 ekleme ve 1 silme
  1. 1 0
      msvc/winsetup.bat
  2. 1 1
      winconfig.h

+ 1 - 0
msvc/winsetup.bat

@@ -4,6 +4,7 @@ if exist config.h if not exist cygconfig.h copy config.h cygconfig.h
 if exist eglib\config.h if not exist eglib\cygconfig.h copy eglib\config.h eglib\cygconfig.h
 copy winconfig.h config.h
 copy eglib\winconfig.h eglib\config.h
+powershell -Command "(Get-Content config.h) -replace '#MONO_VERSION#', (Select-String -path configure.ac -pattern 'AC_INIT\(mono, \[(.*)\]').Matches[0].Groups[1].Value | Set-Content config.h"
 goto end
 :error
 echo fatal error: the VSDepenancies directory was not found in the "mono" directory

+ 1 - 1
winconfig.h

@@ -645,5 +645,5 @@
 /* #undef USE_MONO_MUTEX */
 
 /* Version number of package */
-#define VERSION "4.1.0"
+#define VERSION "#MONO_VERSION#"
 #endif