Skip to content

cmake: CMake 3.13 doesn't like INTERFACE with target_link_libraries #11794

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
yashi opened this issue Dec 2, 2018 · 2 comments · Fixed by #11875
Closed

cmake: CMake 3.13 doesn't like INTERFACE with target_link_libraries #11794

yashi opened this issue Dec 2, 2018 · 2 comments · Fixed by #11875
Assignees
Labels
area: Build System bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug

Comments

@yashi
Copy link
Collaborator

yashi commented Dec 2, 2018

Describe the bug
CMake 3.13 start complaining about CMP0079: target_link_libraries() allows use with targets in other directories.

To Reproduce
Just make for some board.

Expected behavior
No warning while build

Impact
It builds fine but prints the warning a few times.

Screenshots or console output

CMake Warning (dev) at zephyr/cmake/extensions.cmake:837 (target_link_libraries):
  Policy CMP0079 is not set: target_link_libraries allows use with targets in
  other directories.  Run "cmake --help-policy CMP0079" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.

  Target

    zephyr_interface

  is not created in this directory.  For compatibility with older versions of
  CMake, link library

    -ldl

  will be looked up in the directory in which the target was created rather
  than in this calling directory.
Call Stack (most recent call first):
  zephyr/cmake/extensions.cmake:1055 (target_link_libraries_ifdef)
  zephyr/cmake/extensions.cmake:115 (target_ld_options)
  zephyr/arch/posix/CMakeLists.txt:30 (zephyr_ld_options)
This warning is for project developers.  Use -Wno-dev to suppress it.

Environment (please complete the following information):

  • OS: Linux
  • Toolchain: CMake 3.13.1
  • Commit SHA: d38aa1f
@carlescufi carlescufi added area: Build System bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug labels Dec 3, 2018
@SebastianBoe
Copy link
Collaborator

I believe we want to short-term use the cmake_policy() command to set this policy to OLD, and then later on, when necessary, port the code-base to the NEW behaviour and set the policyt to NEW.

@tejlmand
Copy link
Collaborator

tejlmand commented Dec 5, 2018

I believe we want to short-term use the cmake_policy() command to set this policy to OLD, and then later on, when necessary, port the code-base to the NEW behavior and set the policy to NEW.

basically there is no porting needed if allowing the new behavior, current code works on CMP0079 NEW. The reason to state CMP0079 OLD is in order to still allow users to use CMake versions 3.8.2 - 3.13

SebastianBoe added a commit to SebastianBoe/zephyr that referenced this issue Dec 5, 2018
In CMake 3.13 a warning is produced if one does not explicitly state
what the policy for CMP0079 should be. To resolve this warning we set
policy CMP0079 to OLD.

This is expected to have no semantical change. When we want a
semantical change we can flip the policy and port the build scripts to
the new behaviour.

This fixes zephyrproject-rtos#11794

Signed-off-by: Sebastian Bøe <[email protected]>
nashif pushed a commit that referenced this issue Dec 7, 2018
In CMake 3.13 a warning is produced if one does not explicitly state
what the policy for CMP0079 should be. To resolve this warning we set
policy CMP0079 to OLD.

This is expected to have no semantical change. When we want a
semantical change we can flip the policy and port the build scripts to
the new behaviour.

This fixes #11794

Signed-off-by: Sebastian Bøe <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Build System bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants