[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modify bug for template script to generate VC 2013 #21

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

LukeLeo
Copy link
Contributor
@LukeLeo LukeLeo commented Aug 3, 2016

MPC is a best tool to manage C++ project, the version below 2010 works well, but not works for vc2013, I managed to correct the bug and make all my VC2008 project successfully upgraded to VC2013. I tested type for MFC\DLL\LIB etc.

@pmesnier
Copy link
pmesnier commented Aug 3, 2016

Hi Luke,

Thank you for providing this pull request. Can you provide a description of the script you were trying to migrate, and the problems you encountered? Also can you share your default.features file(s), from %ACE_ROOT%/bin/MakeProjectCreator/config/default.features. Also, can you share any custom configuration not generated by MPC. (Ideally this last bit should be empty.

Best regards,
Phil

@LukeLeo
Copy link
Contributor Author
LukeLeo commented Aug 5, 2016

Hi Phil,
Sorry, I'm too busy this week, I'll finish it this weekend but what is default.features, I never seen this file. I only chaned my vc10.mpd and every my problem solved. by the way, I done this with MPC from git, not the one in ACE_wrapper package. I find file mwc.pl both from %ACE_ROOT%/bin and %ACE_ROOT%/MPC. they are different in content, so I try and resolve my problem with git one.

LukeLeo2016@163.com

From: Phil Mesnier
Date: 2016-08-04 06:34
To: DOCGroup/MPC
CC: Luke; Author
Subject: Re: [DOCGroup/MPC] modify bug for template script to generate VC 2013 (#21)
Hi Luke,
Thank you for providing this pull request. Can you provide a description of the script you were trying to migrate, and the problems you encountered? Also can you share your default.features file(s), from %ACE_ROOT%/bin/MakeProjectCreator/config/default.features. Also, can you share any custom configuration not generated by MPC. (Ideally this last bit should be empty.
Best regards,
Phil

You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@LukeLeo
Copy link
Contributor Author
LukeLeo commented Aug 6, 2016

Hi Phil,

Following is my sample script,it work fine under VC 2005 and 2008, but failed under 2013 ;

project(LmxLibUtilToolsus):build_files{
staticname=LmxLibUtilToolsus
pch_header = stdafx.h
pch_source = stdafx.cpp

includes += ..\include 
specific(prop:microsoft){ 
    encoding="gb2312" 
    type_is_static=1 
    UseOfMFC=1 
    unicode=1 
    libout=..\Unicode\$(PlatformName)\lib 
    warning_level=4 
    DisableSpecificWarnings+=4706;4127;4244;4211 
    Debug::runtime_library = 1 
    Release::runtime_library = 0 
} 

Source_Files{ 
    *.cpp 
    no_pch=1 
    stdsoap2.cpp 
}

}

  1. With this script I wrappered one of my offern use C++ libs, which include MFC,gSoap etc. In order to the release version need not rely on VC environment I config it as static fashion (use /MT) ,So I use Script (Debug::runtime_library = 1 and Release::runtime_library = 0) to realize it. when I generated the script and build my project, it tolds me :error : Element has an invalid value of "3". so I change vc10.mpd as following:

from :
<%if(runtime_library)%><%runtime_library%><%else%><%if(type_is_static || need_staticflags)%><%if(debug_prj)%>MultiThreadedDebug<%else%>MultiThreaded<%endif%><%else%><%if(debug_prj)%>MultiThreadedDebugDLL<%else%>MultiThreadedDLL<%endif%><%endif%><%endif%>
to:
<%if(runtime_library)%>
<%if(compares(runtime_library,0))%>MultiThreaded<%else%><%if(compares(runtime_library,1))%>MultiThreadedDebug<%else%><%if(compares(runtime_library,2))%>MultiThreadedDLL<%else%> <%if(compares(runtime_library,3))%>MultiThreadedDebugDLL<%endif%><%endif%><%endif%><%endif%>
<%else%>
<%if(type_is_static || need_staticflags)%><%if(debug_prj)%>MultiThreadedDebug<%else%>MultiThreaded<%endif%><%else%> <%if(debug_prj)%>MultiThreadedDebugDLL<%else%>MultiThreadedDLL<%endif%><%endif%>
<%endif%>

  1. the default git version faild to set depend library when create Lib project my change as following:
    from:
    <%if(type_is_dynamic)%><%if(dllout)%><%dllout%><%else%><%libout%><%endif%><%else%><%if(type_is_static)%><%libout%><%else%><%if(exeout)%><%exeout%><%if(windows_style)%><%output_dir("Debug")%><%endif%><%else%><%if(windows_style)%><%output_dir("Debug")%><%else%><%output_dir(".")%><%endif%><%endif%><%endif%><%endif%>

<%if(type_is_static)%>

<%if(staticname)%>
<%libout%><%libname_prefix%><%staticname%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%lib_ext%>
<%endif%>
%(AdditionalDependencies)

  <AdditionalDependencies><%foreach(reverse(libs))%><%libname_prefix%><%lib%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%lib_ext%>;<%endfor%><%foreach(reverse(lit_libs))%><%lit_lib%>.lib;<%endfor%><%foreach(reverse(pure_libs))%> <%pure_lib%>;<%endfor%>%(AdditionalDependencies)</AdditionalDependencies> 

<%if(exename || sharedname || staticname)%>
$(OutDir)<%if(type_is_dynamic)%><%libname_prefix%><%sharedname%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%dll_ext%><%else%><%exename%><%if(use_exe_modifier)%><%lib_modifier%><%endif%><%exe_ext%><%endif%>
<%endif%>
<%if(ShowProgress)%>
<%ShowProgress%>
<%endif%>
<%if(win_version)%>
<%win_version%>
<%endif%>
<%if(SuppressStartupBanner)%>
true
<%endif%>
<%if(RegisterOutput)%>
true
<%endif%>
<%if(PerUserRedirection)%>
true
<%endif%>
<%foreach(libpaths)%><%libpath%>;<%endfor%>%(AdditionalLibraryDirectories)

to:
<%if(type_is_dynamic)%><%if(dllout)%><%dllout%><%else%><%libout%><%endif%><%else%><%if(type_is_static&&staticname)%><%libout%><%else%><%if(exeout)%><%exeout%><%if(windows_style)%><%output_dir("Debug")%><%endif%><%else%><%if(windows_style)%><%output_dir("Debug")%><%else%><%output_dir(".")%><%endif%><%endif%><%endif%><%endif%>

<%if(type_is_static && staticname)%>

<%if(staticname)%>
<%libout%><%libname_prefix%><%staticname%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%lib_ext%>
<%endif%>
<%foreach(reverse(libs))%><%fornotfirst(";")%><%libname_prefix%><%lib%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%lib_ext%><%endfor%><%foreach(reverse(lit_libs))%>;<%lit_lib%>.lib<%endfor%><%foreach(reverse(pure_libs))%> <%pure_lib%><%endfor%>;%(AdditionalDependencies)

  <AdditionalDependencies><%foreach(reverse(libs))%><%fornotfirst(";")%><%libname_prefix%><%lib%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%lib_ext%><%endfor%><%foreach(reverse(lit_libs))%>;<%lit_lib%>.lib<%endfor%><%foreach(reverse(pure_libs))%> <%pure_lib%><%endfor%>;%(AdditionalDependencies)</AdditionalDependencies> 

<%foreach(libpaths)%><%libpath%>;<%endfor%>%(AdditionalLibraryDirectories)
<%if(exename || sharedname || staticname)%>
$(OutDir)<%if(type_is_dynamic)%><%libname_prefix%><%sharedname%><%if(use_lib_modifier)%><%lib_modifier%><%endif%><%dll_ext%><%else%><%exename%><%if(use_exe_modifier)%><%lib_modifier%><%endif%><%exe_ext%><%endif%>
<%endif%>
<%if(ShowProgress)%>
<%ShowProgress%>
<%endif%>
<%if(win_version)%>
<%win_version%>
<%endif%>
<%if(SuppressStartupBanner)%>
true
<%endif%>
<%if(RegisterOutput)%>
true
<%endif%>
<%if(PerUserRedirection)%>
true
<%endif%>

3.the following change is for consist with vc2008
from:
<%if(type_is_dynamic)%>DynamicLibrary<%else%><%if(type_is_static && staticname)%>StaticLibrary<%else%><%if(custom_only)%>Utility<%else%><%if(makeoutput)%>Makefile<%else%>Application<%endif%><%endif%><%endif%><%endif%>
<%if(UseOfMFC)%>
<%UseOfMFC%>

<%if(!managed && debug_format)%>
<%debug_format%>
<%endif%>

to:
<%if(type_is_static && staticname)%>StaticLibrary<%else%><%if(type_is_dynamic)%>DynamicLibrary<%else%><%if(custom_only)%>Utility<%else%><%if(makeoutput)%>Makefile<%else%>Application<%endif%><%endif%><%endif%><%endif%>
<%if(UseOfMFC)%>
<%if(compares(UseOfMFC,1))%>Static<%else%><%if(compares(UseOfMFC,2))%>Dynamic<%endif%><%endif%>
<%else%>
false

<%if(!managed && debug_format)%>
<%if(compares(debug_format, 0))%>None<%else%><%if(compares(debug_format, 1))%>OldStyle<%else%><%if(compares(debug_format, 2))%>ProgramDatabase<%else%><%if(compares(debug_format, 3))%>EditAndContinue<%endif%><%endif%><%endif%><%endif%>
<%endif%>

with these change, both vc2008 and vc 2013 can use the same script and works well, I think this is the purpose of MPC development

LukeLeo2016@163.com

From: Phil Mesnier
Date: 2016-08-04 06:34
To: DOCGroup/MPC
CC: Luke; Author
Subject: Re: [DOCGroup/MPC] modify bug for template script to generate VC 2013 (#21)
Hi Luke,
Thank you for providing this pull request. Can you provide a description of the script you were trying to migrate, and the problems you encountered? Also can you share your default.features file(s), from %ACE_ROOT%/bin/MakeProjectCreator/config/default.features. Also, can you share any custom configuration not generated by MPC. (Ideally this last bit should be empty.
Best regards,
Phil

You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@pmesnier
Copy link

Hi Luke, Thank you for the updates. Now it is my turn to apologize for letting this linger.

I think when I asked for any configuration changes, I was looking for changes to existing content, or new content that was required by the template changes you added. It seems all the config/luke*mpb files you've added are extensions you find personally useful, but are not required for others to benefit from your VC2013 template. Is this an accurate description of those files?

I do not like that you prefix the mpb file names with "luke." I appreciate the motivation, but I think the base module name should be more product specific, or name specialization should be more product-specific. It might be better to collect your files into a separate directory and add documentation to indicate that you have assembled a list of useful projects that augment the new VC2013 template.

In fact, are your new luke*mpb files specific to the new template, or are they useful for other MSVC's as well? I would like to discuss this with some folks back here, but I think adding a new "contrib" directory under which you could add a "luke" directory might do the trick. The new documentation will then state that to use these new base projects, one needs to add "$MPC_ROOT/contrib/luke/config/" to the "includes = " line of their local MPC.cfg file.

In addition to the new projects, I see a number of luke_mpb files that seem to supersede existing mpbs, such as lukeopenssl.mpb. However I don't see any explicit dependency on this, or any other luke_ files. So how exactly do you use these new mpb files?

Best regards,
Phil

@jwillemsen
Copy link
Member

I would not be in favor of adding contrib, these luke mpb files can easily be shared by the author in a separate git repository. If there are pure product mpb files that we lack we could add a product mpb that can more easily be used by others and also maintained

@LukeLeo
Copy link
Contributor Author
LukeLeo commented Sep 27, 2016

Hi, everybody. I'm sorry for answering so late, I'm a green hand for using github and git. I'm applogize for pushing those mpb file start with luke. It's only template used by my team, and without out source code it can do nothing. the only file to enhance VS2013 is the one vc10.mpt

@LukeLeo
Copy link
Contributor Author
LukeLeo commented Dec 9, 2016

when I create VC 2013 project with MPC I found one bug in the script, the mismatch VC version in VC11WorkspaceCreator.pm and VC12WorkspaceCreator.pm will leade to upgrade prompt with MPC generated project. btw vs2015=>14 vs2013=>12 vs2012=>11 vs2010=> ,the former two pm file mistake the vs version match.

@jwillemsen
Copy link
Member

When you can make a separate pull request of the last changes we can quickly integrate those, they don't require testing or something like that.

@LukeLeo
Copy link
Contributor Author
LukeLeo commented Jan 9, 2017

how to make a separate pull request? I'm not familiar with github and failed many times to try. @jwillemsen

@jwillemsen
Copy link
Member

See for example http://blog.asquareb.com/blog/2014/06/19/making-a-git-pull-request-for-specific-commits/. You should create a new branch and do a cherry-pick of just that single change and open a new PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants