Re: [cmake-developers] Global flags for creating static libraries

2013-04-08 Thread Brad King
On 12/17/2012 09:50 AM, Brad King wrote:
> On 12/17/2012 02:01 AM, Evan Pipho wrote:
>> Cleaned up the commits
>>
>> See the new branch here:
>> https://github.com/hiwrac/CMake/commits/static_linker_flags_clean
>>
>> CMAKE_STATIC_LINKER_FLAGS is now optional on all generators. 
>> XCode is supported properly.
> 
> 1. I still see some GetRequiredDefinition used.
> 
> 2. Please format C++ code in less than 80 columns.  Run this
>check on your topic and ensure it is empty:
> 
>  $ git log origin/master.. --pickaxe-regex -S'.{80}' -- Source
> 
> 3. The addition of /MACHINE:xxx to librarian calls is a change in
>behavior.  According to the documentation of lib.exe:
> 
> http://msdn.microsoft.com/en-us/library/h34w59b3.aspx
> 
>The flag is usually not needed.  In what cases do you need it?
> 
> 4. Please construct a test case that covers these flags.  It is
>okay if it runs only with MS tools because that is the motivating
>case anyway.  In Tests/CMakeLists.txt there is a CMAKE_TEST_MSVC
>condition that adds some MS-specific tests.

There is additional discussion and another proposed implementation here:

 http://www.cmake.org/Bug/view.php?id=10094
 https://github.com/Kitware/CMake/pull/40

-Brad
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] Global flags for creating static libraries

2012-12-17 Thread Brad King
On 12/17/2012 02:01 AM, Evan Pipho wrote:
> Cleaned up the commits
> 
> See the new branch here:
> https://github.com/hiwrac/CMake/commits/static_linker_flags_clean
> 
> CMAKE_STATIC_LINKER_FLAGS is now optional on all generators. 
> XCode is supported properly.

1. I still see some GetRequiredDefinition used.

2. Please format C++ code in less than 80 columns.  Run this
   check on your topic and ensure it is empty:

 $ git log origin/master.. --pickaxe-regex -S'.{80}' -- Source

3. The addition of /MACHINE:xxx to librarian calls is a change in
   behavior.  According to the documentation of lib.exe:

http://msdn.microsoft.com/en-us/library/h34w59b3.aspx

   The flag is usually not needed.  In what cases do you need it?

4. Please construct a test case that covers these flags.  It is
   okay if it runs only with MS tools because that is the motivating
   case anyway.  In Tests/CMakeLists.txt there is a CMAKE_TEST_MSVC
   condition that adds some MS-specific tests.

Thanks,
-Brad
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] Global flags for creating static libraries

2012-12-16 Thread Evan Pipho
Cleaned up the commits

See the new branch here:
https://github.com/hiwrac/CMake/commits/static_linker_flags_clean

CMAKE_STATIC_LINKER_FLAGS is now optional on all generators.
XCode is supported properly.


On Tue, Dec 11, 2012 at 8:44 AM, Brad King  wrote:

> On 12/10/2012 05:45 PM, Evan Pipho wrote:
> > I am nearly finished with this, just need to write the variable
> documentation and test the xcode generators.
>
> Thanks for working on this.
>
> > I have committed everything so far to my github fork at
> >  https://github.com/hiwrac/CMake/commits/static_linker_flags
>
> We can fetch your topic from there so there is no need for a
> separate submission.
>
> I just took a quick look.  Here are some comments.
>
> (1) Please arrange your commits to do cleanup and rearrangement
> changes first, and then real changes in separate commits.
> Currently both are mixed together so it is hard to see what
> happened to existing functionality (like target properties).
>
> (2) GetRequiredDefinition is too strict for this.  We do not
> actually need to have a definition of these variables to
> produce a valid build system.  Use plain GetDefinition
> and simply skip the feature if it returns NULL.
>
> Please rewrite your topic to address these and then post back
> here so we can take another look.
>
> Thanks!
> -Brad
>
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Re: [cmake-developers] Global flags for creating static libraries

2012-12-11 Thread Brad King
On 12/10/2012 05:45 PM, Evan Pipho wrote:
> I am nearly finished with this, just need to write the variable documentation 
> and test the xcode generators. 

Thanks for working on this.

> I have committed everything so far to my github fork at 
>  https://github.com/hiwrac/CMake/commits/static_linker_flags 

We can fetch your topic from there so there is no need for a
separate submission.

I just took a quick look.  Here are some comments.

(1) Please arrange your commits to do cleanup and rearrangement
changes first, and then real changes in separate commits.
Currently both are mixed together so it is hard to see what
happened to existing functionality (like target properties).

(2) GetRequiredDefinition is too strict for this.  We do not
actually need to have a definition of these variables to
produce a valid build system.  Use plain GetDefinition
and simply skip the feature if it returns NULL.

Please rewrite your topic to address these and then post back
here so we can take another look.

Thanks!
-Brad
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] Global flags for creating static libraries

2012-12-10 Thread Evan Pipho
I am nearly finished with this, just need to write the variable
documentation and test the xcode generators.

Once that is complete what is the best way to submit a change this
size? While it is not very complex, it did touch a good number of files
since it affected many generators.

I have committed everything so far to my github fork at
 https://github.com/hiwrac/CMake/commits/static_linker_flags

I can easily generate a patch file of the whole branch and attach it to the
bug, just wondering if there is another preferred way.

Thanks
-Evan

On Fri, Dec 7, 2012 at 7:35 PM, Evan Pipho  wrote:

> Thanks Brad, I will start taking a look this weekend.
>
> As for flags being passed to the librarian /LTCG for whole program
> optimization is probably the most common (and came up the most when I
> searched on this issue) but controlling warnings with /ignore and turning
> on warnings as errors (/wx) is also useful.
>
>
>
> On Fri, Dec 7, 2012 at 10:41 AM, Brad King  wrote:
>
>> On 12/07/2012 12:04 AM, Evan Pipho wrote:
>> > I am looking for a way to set global flags for the librarian when
>> creating static libraries, similar to CMAKE_SHARED_LINKER_FLAGS or
>> CMAKE_EXE_LINKER_FLAGS.  This would facilitate things like using 3rd party
>> libraries that already use cmake without having to modify their
>> CMakeLists.txt to set these
>> > flags.
>> >
>> >
>> > I found http://public.kitware.com/Bug/view.php?id=10094 which
>> mentions using CMAKE_STATIC_LINKER_FLAGS as well as this fairly old thread
>> http://www.cmake.org/pipermail/cmake/2009-October/032563.html also
>> mentioning this.
>> >
>> > Has there been any progress on this feature?
>> > If not, does a feature that exposes a CMAKE_STATIC_LINKER_FLAGS
>> (and CMAKE_STATIC_LINKER_FLAGS_) which are then passed to the
>> librarian (ar, lib.exe etx) make sense?  I think this would be quite
>> useful, especially for those of us that use cmake with visual studio.
>> >
>> > I would like to get the lists input, and if it is positive I would
>> be interested in creating a patch to add this functionality.
>>
>> There is also this issue:
>>
>>  http://www.cmake.org/Bug/view.php?id=10768
>>
>> which was resolved here:
>>
>>  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fe971d97
>>  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d3303dbc
>>
>> to add a STATIC_LIBRARY_FLAGS_ version of the property
>> as requested in the mailing list thread you linked.
>>
>> What is still missing is the cache variables equivalent to
>>
>>  CMAKE_EXE_LINKER_FLAGS
>>  CMAKE_EXE_LINKER_FLAGS_
>>  CMAKE_SHARED_LINKER_FLAGS
>>  CMAKE_SHARED_LINKER_FLAGS_
>>  CMAKE_MODULE_LINKER_FLAGS
>>  CMAKE_MODULE_LINKER_FLAGS_
>>
>> for static libraries.  Following the above convention the names
>>
>>  CMAKE_STATIC_LINKER_FLAGS
>>  CMAKE_STATIC_LINKER_FLAGS_
>>
>> make sense even though no linking is actually performed.  To add
>> them, look for places already handling the above variables and
>> find the equivalents for static libs.  You will need to modify at
>> least:
>>
>>  cmLocalGenerator::GetTargetFlags
>>  cmGlobalXCodeGenerator::CreateBuildSettings
>>  cmMakefileLibraryTargetGenerator::WriteStaticLibraryRules
>>  cmLocalVisualStudio7Generator::OutputBuildTool
>>  cmLocalVisualStudio6Generator::WriteDSPHeader
>>
>> You will also need to modify the module
>>
>>  Modules/CMakeCommonLanguageInclude.cmake
>>
>> to add the empty default cache entries.  Finally, look in the
>> cmDocumentVariables.cxx source file to add documentation.
>>
>> BTW, what kind of flags do you want to add to the librarian?
>>
>> -Brad
>>
>
>
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Re: [cmake-developers] Global flags for creating static libraries

2012-12-07 Thread Evan Pipho
Thanks Brad, I will start taking a look this weekend.

As for flags being passed to the librarian /LTCG for whole program
optimization is probably the most common (and came up the most when I
searched on this issue) but controlling warnings with /ignore and turning
on warnings as errors (/wx) is also useful.



On Fri, Dec 7, 2012 at 10:41 AM, Brad King  wrote:

> On 12/07/2012 12:04 AM, Evan Pipho wrote:
> > I am looking for a way to set global flags for the librarian when
> creating static libraries, similar to CMAKE_SHARED_LINKER_FLAGS or
> CMAKE_EXE_LINKER_FLAGS.  This would facilitate things like using 3rd party
> libraries that already use cmake without having to modify their
> CMakeLists.txt to set these
> > flags.
> >
> >
> > I found http://public.kitware.com/Bug/view.php?id=10094 which
> mentions using CMAKE_STATIC_LINKER_FLAGS as well as this fairly old thread
> http://www.cmake.org/pipermail/cmake/2009-October/032563.html also
> mentioning this.
> >
> > Has there been any progress on this feature?
> > If not, does a feature that exposes a CMAKE_STATIC_LINKER_FLAGS (and
> CMAKE_STATIC_LINKER_FLAGS_) which are then passed to the librarian
> (ar, lib.exe etx) make sense?  I think this would be quite useful,
> especially for those of us that use cmake with visual studio.
> >
> > I would like to get the lists input, and if it is positive I would
> be interested in creating a patch to add this functionality.
>
> There is also this issue:
>
>  http://www.cmake.org/Bug/view.php?id=10768
>
> which was resolved here:
>
>  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fe971d97
>  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d3303dbc
>
> to add a STATIC_LIBRARY_FLAGS_ version of the property
> as requested in the mailing list thread you linked.
>
> What is still missing is the cache variables equivalent to
>
>  CMAKE_EXE_LINKER_FLAGS
>  CMAKE_EXE_LINKER_FLAGS_
>  CMAKE_SHARED_LINKER_FLAGS
>  CMAKE_SHARED_LINKER_FLAGS_
>  CMAKE_MODULE_LINKER_FLAGS
>  CMAKE_MODULE_LINKER_FLAGS_
>
> for static libraries.  Following the above convention the names
>
>  CMAKE_STATIC_LINKER_FLAGS
>  CMAKE_STATIC_LINKER_FLAGS_
>
> make sense even though no linking is actually performed.  To add
> them, look for places already handling the above variables and
> find the equivalents for static libs.  You will need to modify at
> least:
>
>  cmLocalGenerator::GetTargetFlags
>  cmGlobalXCodeGenerator::CreateBuildSettings
>  cmMakefileLibraryTargetGenerator::WriteStaticLibraryRules
>  cmLocalVisualStudio7Generator::OutputBuildTool
>  cmLocalVisualStudio6Generator::WriteDSPHeader
>
> You will also need to modify the module
>
>  Modules/CMakeCommonLanguageInclude.cmake
>
> to add the empty default cache entries.  Finally, look in the
> cmDocumentVariables.cxx source file to add documentation.
>
> BTW, what kind of flags do you want to add to the librarian?
>
> -Brad
>
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Re: [cmake-developers] Global flags for creating static libraries

2012-12-07 Thread Brad King
On 12/07/2012 12:04 AM, Evan Pipho wrote:
> I am looking for a way to set global flags for the librarian when creating 
> static libraries, similar to CMAKE_SHARED_LINKER_FLAGS or 
> CMAKE_EXE_LINKER_FLAGS.  This would facilitate things like using 3rd party 
> libraries that already use cmake without having to modify their 
> CMakeLists.txt to set these
> flags.
>  
> 
> I found http://public.kitware.com/Bug/view.php?id=10094 which mentions 
> using CMAKE_STATIC_LINKER_FLAGS as well as this fairly old thread 
> http://www.cmake.org/pipermail/cmake/2009-October/032563.html also mentioning 
> this.
> 
> Has there been any progress on this feature?
> If not, does a feature that exposes a CMAKE_STATIC_LINKER_FLAGS (and 
> CMAKE_STATIC_LINKER_FLAGS_) which are then passed to the librarian 
> (ar, lib.exe etx) make sense?  I think this would be quite useful, especially 
> for those of us that use cmake with visual studio.
> 
> I would like to get the lists input, and if it is positive I would be 
> interested in creating a patch to add this functionality.

There is also this issue:

 http://www.cmake.org/Bug/view.php?id=10768

which was resolved here:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fe971d97
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d3303dbc

to add a STATIC_LIBRARY_FLAGS_ version of the property
as requested in the mailing list thread you linked.

What is still missing is the cache variables equivalent to

 CMAKE_EXE_LINKER_FLAGS
 CMAKE_EXE_LINKER_FLAGS_
 CMAKE_SHARED_LINKER_FLAGS
 CMAKE_SHARED_LINKER_FLAGS_
 CMAKE_MODULE_LINKER_FLAGS
 CMAKE_MODULE_LINKER_FLAGS_

for static libraries.  Following the above convention the names

 CMAKE_STATIC_LINKER_FLAGS
 CMAKE_STATIC_LINKER_FLAGS_

make sense even though no linking is actually performed.  To add
them, look for places already handling the above variables and
find the equivalents for static libs.  You will need to modify at
least:

 cmLocalGenerator::GetTargetFlags
 cmGlobalXCodeGenerator::CreateBuildSettings
 cmMakefileLibraryTargetGenerator::WriteStaticLibraryRules
 cmLocalVisualStudio7Generator::OutputBuildTool
 cmLocalVisualStudio6Generator::WriteDSPHeader

You will also need to modify the module

 Modules/CMakeCommonLanguageInclude.cmake

to add the empty default cache entries.  Finally, look in the
cmDocumentVariables.cxx source file to add documentation.

BTW, what kind of flags do you want to add to the librarian?

-Brad
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] Global flags for creating static libraries

2012-12-06 Thread Evan Pipho
Moving this to the developer list where I meant it to be, rather than on
the cmake users list.  Sorry for anyone who gets it twice.


I am looking for a way to set global flags for the librarian when creating
static libraries, similar to CMAKE_SHARED_LINKER_FLAGS
or CMAKE_EXE_LINKER_FLAGS.  This would facilitate things like using 3rd
party libraries that already use cmake without having to modify their
CMakeLists.txt to set these flags.


> I found http://public.kitware.com/Bug/view.php?id=10094 which mentions
> using CMAKE_STATIC_LINKER_FLAGS as well as this fairly old thread
> http://www.cmake.org/pipermail/cmake/2009-October/032563.html also
> mentioning this.
>
> Has there been any progress on this feature?
> If not, does a feature that exposes a CMAKE_STATIC_LINKER_FLAGS (and
> CMAKE_STATIC_LINKER_FLAGS_) which are then passed to the librarian
> (ar, lib.exe etx) make sense?  I think this would be quite useful,
> especially for those of us that use cmake with visual studio.
>
> I would like to get the lists input, and if it is positive I would be
> interested in creating a patch to add this functionality.
>
> Thanks
>
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers