On Wed, Dec 18, 2013 at 11:54:15PM +0000, Roger Leigh wrote:
>   set(a_static_headers …)
>   set(b_static_sources …)
>   add_custom_command(OUTPUT ${a_generated_headers}
> ${a_generated_sources} COMMAND ${custom_tool} DEPENDS
> ${tool_dependencies)
>   set(a_headers ${a_generated_headers} ${a_static_headers})
>   set(a_sources ${a_generated_sources} ${a_static_sources})
>   add_library(a SHARED ${a_sources} ${a_headers})
> 
> Module b:
>   set(b_headers …)
>   set(b_sources …)
>   add_library(b SHARED ${b_sources} ${b_headers})
>   target_link_libraries(b a)
> 
> The code generation, compiling and linking of module a works fine,
> and the code is regenerated if the dependencies are touched.  This
> works building serially or in parallel.
> 
> The compiling and linking of module b works fine only if building
> serially.  If building in parallel, the ${b_sources} which include
> any headers from module a's ${a_generated_headers} will fail if they
> are built before header generation in module a occurs.  This is
> inherently racy.

Sorry for the noise, I found that I did in fact have some missing
target_link_libraries in some autogenerated tests (too much
autogeneration going on...).  Adding target_link_libraries for
everything fixes the dependencies and parallel building then
works just fine.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux    http://people.debian.org/~rleigh/
 `. `'   schroot and sbuild  http://alioth.debian.org/projects/buildd-tools
   `-    GPG Public Key      F33D 281D 470A B443 6756 147C 07B3 C8BC 4083 E800
--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to