@@ -549,8 +549,8 @@ class WindowsPlatform extends PlatformTarget
549549 }
550550 else
551551 {
552- var haxeArgs = [hxml ];
553- var flags = [];
552+ var haxeArgs = [hxml , " -D " , " resourceFile=ApplicationMain.rc " ];
553+ var flags = [" -DresourceFile=ApplicationMain.rc " ];
554554
555555 if (is64 )
556556 {
@@ -679,6 +679,29 @@ class WindowsPlatform extends PlatformTarget
679679 }
680680 else
681681 {
682+ if (targetType == " cpp" )
683+ {
684+ if (context. APP_DESCRIPTION == null || context. APP_DESCRIPTION == " " )
685+ {
686+ context. APP_DESCRIPTION = project .meta .title ;
687+ }
688+
689+ if (context. APP_COPYRIGHT_YEARS == null || context. APP_COPYRIGHT_YEARS == " " )
690+ {
691+ context. APP_COPYRIGHT_YEARS = Std .string (Date .now ().getFullYear ());
692+ }
693+
694+ var versionParts = project .meta .version .split (" ." );
695+
696+ if (versionParts .length == 3 )
697+ {
698+ versionParts .push (" 0" );
699+ }
700+
701+ context. FILE_VERSION = versionParts .join (" ." );
702+ context. VERSION_NUMBER = versionParts .join (" ," );
703+ }
704+
682705 context. NEKO_FILE = targetDirectory + " /obj/ApplicationMain.n" ;
683706 context. NODE_FILE = targetDirectory + " /bin/ApplicationMain.js" ;
684707 context. HL_FILE = targetDirectory + " /obj/ApplicationMain" + (project .defines .exists (" hlc" ) ? " .c" : " .hl" );
@@ -987,9 +1010,14 @@ class WindowsPlatform extends PlatformTarget
9871010 ProjectHelper .recursiveSmartCopyTemplate (project , " winrt/temp" , targetDirectory + " /haxe/temp" , context , false , true );
9881011 ProjectHelper .recursiveSmartCopyTemplate (project , " winrt/scripts" , targetDirectory + " /scripts" , context , true , true );
9891012 }
990- else if (targetType == " cpp" && project . targetFlags . exists ( " static " ) )
1013+ else if (targetType == " cpp" )
9911014 {
992- ProjectHelper .recursiveSmartCopyTemplate (project , " cpp/static" , targetDirectory + " /obj" , context );
1015+ ProjectHelper .recursiveSmartCopyTemplate (project , " windows/resource" , targetDirectory + " /obj" , context );
1016+
1017+ if (project .targetFlags .exists (" static" ))
1018+ {
1019+ ProjectHelper .recursiveSmartCopyTemplate (project , " cpp/static" , targetDirectory + " /obj" , context );
1020+ }
9931021 }
9941022
9951023 /* if (IconHelper.createIcon (project.icons, 32, 32, Path.combine (applicationDirectory, "icon.png"))) {
0 commit comments