[cmake-developers] $<BUILD_INTERFACE> genex regression

Nils Gladitz nilsgladitz at gmail.com
Fri Oct 10 05:09:54 EDT 2014


"cmTarget: Refactor ComputeLinkImplementation" (24637979):
   http://www.cmake.org/gitweb?p=cmake.git;a=commit;h=24637979

Seems to have broken this reduced testcase:
   cmake_minimum_required(VERSION 3.0)

   set(LIBRARIES
       foobar.lib
       barfoo.lib
   )

   add_executable(foo foo.cpp)
   target_link_libraries(foo PUBLIC $<BUILD_INTERFACE:${LIBRARIES}>)

For the Ninja generator in 3.0 this produces a "build.ninja" with:
   LINK_LIBRARIES = -rdynamic -lfoobar.lib -lbarfoo.lib

Since 24637979 this produces:
   LINK_LIBRARIES = -rdynamic $<BUILD_INTERFACE:foobar.lib -lbarfoo.lib>

I can work around this by wrapping the libraries with $<BUILD_INTERFACE> 
individually or by quoting the entire genex.

Given the title of the commit I'm guessing this wasn't an intentional 
change of behavior?

Nils



More information about the cmake-developers mailing list