Author Topic: wizard 'staticlib' help  (Read 5153 times)

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 531
  • L'ami de l'homme.The friend of man.
    • LETARTARE
wizard 'staticlib' help
« on: February 03, 2013, 02:43:10 pm »
hello,
environment :
Quote
Vista Business Pack 2,   Mingw32 with TDM-GCC 4.7.1
C::B 12.11 release (wxWidgets unicode 2.8.12)

With the help of the wizard
Quote
'File->New->Project->Static library'
I create a static library project 'libOne.cbp':
Quote
Project title = 'libOne'
Compiler =  'GNU  GCC compiler 4.7.1'
Create Release configuration = 'One'
Output dir = 'lib\'
Objects output dir = 'obj'

I watch 'Project-> Properties-> Build targets' :
Quote
Output filename = 'libOne.a'
path Output dir = 'lib\' does not appear !
I waited 'lib\libOne.a'.

Generation is correct and the library is in the root of the project :
Quote
libOne.a

Where is the error ?

« Last Edit: February 03, 2013, 03:04:02 pm by LETARTARE »
CB-13483, plugins-sdk-2.25.0 : Collector-2.0.0, AddOnForQt-3.9.1
1-Win7 Business Pack1 64bits : wx-3.2.4, gcc-8.1.0,
2-OpenSuse::Leap-15.4-64bits : wx-3.2.4;gtk3, gcc-8.2.1,
=> !! The messages are translated by Deepl

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 531
  • L'ami de l'homme.The friend of man.
    • LETARTARE
Re: wizard 'staticlib' help
« Reply #1 on: February 04, 2013, 05:39:42 pm »
hello,
the error was in the file 'staticlib/wizard.script'.
in function :
Code
function SetupTarget(target, is_debug)
{
    if (IsNull(target))
        return false;

    target.SetTargetType(ttStaticLib);
   
    if (target.GetWorkingDir().Matches(_T("")))
        target.SetOutputFilename(target.SuggestOutputFilename());
    else
        target.SetOutputFilename(target.GetWorkingDir() + wxFILE_SEP_PATH + target.SuggestOutputFilename());

    if (is_debug)
    {
        // enable debugging symbols for this target
        // DebugSymbolsOn(target, Wizard.GetTargetCompilerID()); // TODO: doesn't seem to work?
        DebugSymbolsOn(target, Wizard.GetCompilerID());
    }
    else
    {
        // enable optimizations for this target
        // OptimizationsOn(target, Wizard.GetTargetCompilerID()); // TODO: doesn't seem to work?
        OptimizationsOn(target, Wizard.GetCompilerID());
    }

    return true;
}
the function
Quote
GetWorkingDir() -> wxString CompileTargetBase::GetWorkingDir()
always returns _T("") for a target 'ttstaticlib'
So it is always
Code
target.SetOutputFilename (target.SuggestOutputFilename ());
which is executed.

I propose
Code
local outputdir = _T("")
    if ( target.GetTitle().Matches(Wizard.GetDebugName()) )
outputdir = Wizard.GetDebugOutputDir()
    if ( target.GetTitle().Matches(Wizard.GetReleaseName()) )
outputdir = Wizard.GetReleaseOutputDir()

    if (target.GetWorkingDir().Matches(_T("")))   /// ALWAYS !!
        target.SetOutputFilename( outputdir + target.SuggestOutputFilename());

With this fix, generation is correctly positioned
Quote
lib\libOne.a

Could you check this proposal ?


CB-13483, plugins-sdk-2.25.0 : Collector-2.0.0, AddOnForQt-3.9.1
1-Win7 Business Pack1 64bits : wx-3.2.4, gcc-8.1.0,
2-OpenSuse::Leap-15.4-64bits : wx-3.2.4;gtk3, gcc-8.2.1,
=> !! The messages are translated by Deepl

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 531
  • L'ami de l'homme.The friend of man.
    • LETARTARE
Re: wizard 'staticlib' help
« Reply #2 on: February 04, 2013, 06:24:10 pm »
If you add a target (static library) in a project  include the same problem
Also must add more:   
Code
local outputdir = _T("")
    if ( target.GetTitle().Matches(Wizard.GetDebugName()) )
   outputdir = Wizard.GetDebugOutputDir()
    else
    if ( target.GetTitle().Matches(Wizard.GetReleaseName()) )
   outputdir = Wizard.GetReleaseOutputDir()
    else
          outputdir = Wizard.GetTargetOutputDir()
which take into account the directory 'Output dir'

Cordially.
CB-13483, plugins-sdk-2.25.0 : Collector-2.0.0, AddOnForQt-3.9.1
1-Win7 Business Pack1 64bits : wx-3.2.4, gcc-8.1.0,
2-OpenSuse::Leap-15.4-64bits : wx-3.2.4;gtk3, gcc-8.2.1,
=> !! The messages are translated by Deepl

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: wizard 'staticlib' help
« Reply #3 on: February 04, 2013, 09:52:43 pm »
Could you generate a patch with svn diff please?

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 531
  • L'ami de l'homme.The friend of man.
    • LETARTARE
Re: wizard 'staticlib' help
« Reply #4 on: February 04, 2013, 10:48:16 pm »
yes
with CB 12.11 r8628
CB-13483, plugins-sdk-2.25.0 : Collector-2.0.0, AddOnForQt-3.9.1
1-Win7 Business Pack1 64bits : wx-3.2.4, gcc-8.1.0,
2-OpenSuse::Leap-15.4-64bits : wx-3.2.4;gtk3, gcc-8.2.1,
=> !! The messages are translated by Deepl

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: wizard 'staticlib' help
« Reply #5 on: February 10, 2013, 04:35:23 am »
Sorry, this got lost.
If I do not say anything in a few days, could you please remind me?

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 531
  • L'ami de l'homme.The friend of man.
    • LETARTARE
Re: wizard 'staticlib' help
« Reply #6 on: February 16, 2013, 01:05:12 pm »
@ Aplha
requested as a reminder.
with a new patch for  'staticlib/wizard.script' (check).

I found that other wizards are in the same situation :
Quote
fortran/lib/wizard.script
ogre/wizard.script
sys/wizard.script

thank you
CB-13483, plugins-sdk-2.25.0 : Collector-2.0.0, AddOnForQt-3.9.1
1-Win7 Business Pack1 64bits : wx-3.2.4, gcc-8.1.0,
2-OpenSuse::Leap-15.4-64bits : wx-3.2.4;gtk3, gcc-8.2.1,
=> !! The messages are translated by Deepl

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: wizard 'staticlib' help
« Reply #7 on: February 16, 2013, 04:45:56 pm »
Thanks for the reminder.  Attached is a slightly different way of fixing the problem.  (This works for me, however, I would appreciate if you could check it on your test cases as well.)
I did not patch the OGRE wizard because it is more complicated, and I do not currently have OGRE installed to test with.

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 531
  • L'ami de l'homme.The friend of man.
    • LETARTARE
Re: wizard 'staticlib' help
« Reply #8 on: February 16, 2013, 05:31:31 pm »
thanks
I have not installed OGRE to test.

On my system I tested came with three changes
Quote
12.11
and
Quote
r8818
This time the paths given are taken into consideration properly

Well done Alpha


CB-13483, plugins-sdk-2.25.0 : Collector-2.0.0, AddOnForQt-3.9.1
1-Win7 Business Pack1 64bits : wx-3.2.4, gcc-8.1.0,
2-OpenSuse::Leap-15.4-64bits : wx-3.2.4;gtk3, gcc-8.2.1,
=> !! The messages are translated by Deepl

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 531
  • L'ami de l'homme.The friend of man.
    • LETARTARE
Re: wizard 'staticlib' help
« Reply #9 on: February 16, 2013, 06:13:05 pm »
To test Ogre, simply create a directory lure:
Quote
?\VirtuelOgre\include\ogre.h
ogre.h is empty
and choose the source code ...

I tried but it seems that their execution directory can be written in
Quote
?\VirtualOgre\bin\Release
Quote
?\ VirtualOgre\bin\Debug

I do not know the wishes of the developer wizard ...
I can not go further.
CB-13483, plugins-sdk-2.25.0 : Collector-2.0.0, AddOnForQt-3.9.1
1-Win7 Business Pack1 64bits : wx-3.2.4, gcc-8.1.0,
2-OpenSuse::Leap-15.4-64bits : wx-3.2.4;gtk3, gcc-8.2.1,
=> !! The messages are translated by Deepl

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: wizard 'staticlib' help
« Reply #10 on: February 20, 2013, 12:05:58 am »
Probably it would be best to leave this wizard alone until someone who uses it explains the purpose.