On Thu, Sep 12, 2013 at 1:32 PM, Brad King <[email protected]> wrote:
> On 09/12/2013 03:08 PM, James Bigler wrote: > > In 2.8.12 and 2.8.11.2 I noticed the following problem for VS 2012 > builds. > > VS 2010 builds are fine. Also CMake 2.8.10.1 works just fine. > > > > VS 2012 doesn't link the objects into a library. > [snip] > > Broken project: > > <LinkObjects > Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkObjects> > > > > In the working case this isn't in there at all. > > I suspect this change is related: > > http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b684b395 > > It was added in 2.8.11 and is specific to VS >= 11. It adds the > LinkObjects element inside custom commands to tell VS not to link > the custom command output by default. > > However, if the object has EXTERNAL_OBJECT set then there should > be a separate <Object> entry for it that tells VS to link it in. > > -Brad > -- > I do set the EXTERNAL_OBJECT property. if( NOT compile_to_ptx ) set_source_files_properties("${generated_file}" PROPERTIES EXTERNAL_OBJECT true # This is an object file not to be compiled, but only be linked. ) endif() Now, to be clear, I don't actually add the object file to the build, because VS would link in the output of the custom command when using the MAIN_DEPENDENCY feature of the custom command. Should I set this property on the source file itself? James
-- 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
