Skip to content
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

No way to build with cpplog with Ninja, also it does not find installed cpplog #113

Open
illwieckz opened this issue Oct 27, 2022 · 3 comments

Comments

@illwieckz
Copy link

With default source I get:

ninja: error: 'cpplog/src/cpplog-project-build/libcpplog-static.a', needed by 'src/libVC4CC.so.0.4.9999',
 missing and no known rule to make it

With this patch:

diff --git a/cmake/cpplog.cmake b/cmake/cpplog.cmake
index 84b5245..41fcced 100644
--- a/cmake/cpplog.cmake
+++ b/cmake/cpplog.cmake
@@ -1,4 +1,4 @@
-if(FALSE AND DEPENDENCIES_USE_FETCH_CONTENT)
+if(DEPENDENCIES_USE_FETCH_CONTENT)
        # TODO disabled for now, since cpplog uninstall target conflicts with VC4C uninstall target
        include(FetchContent)
        FetchContent_Declare(cpplog GIT_REPOSITORY https://github.com/doe300/cpplog.git GIT_TAG v0.6)

I get:

CMake Error at src/CMakeLists.txt:146 (add_custom_target):
  add_custom_target cannot create target "uninstall" because another target
  with the same name already exists.  The existing target is a custom target
  created in source directory "VC4C/build/_deps/cpplog-src".
  See documentation for policy CMP0002 for more details.

If I install cpplog in the install prefix as an alternative way to build and provide it, CMake doesn't find it.

I guess either making the cpplog install step conditional to not being part of a parent project, either making vc4cl finds installed cpplog, would fix that. Right now both building as part of vc4cl or separately can't make vc4cl build.

@illwieckz illwieckz changed the title No way to build with cpplog, also it does not find installed cpplog No way to build with cpplog with Ninja, also it does not find installed cpplog Nov 2, 2022
@illwieckz
Copy link
Author

It looks like this error is specific to Ninja:

ninja: error: 'cpplog/src/cpplog-project-build/libcpplog-static.a', needed by 'src/libVC4CC.so.0.4.9999',
 missing and no known rule to make it

When I run cmake with -G'Unix Makefiles' it continues.

Anyway this is an issue for VC4C, I reported it on the wrong repo, this may me moved to VC4C.

@doe300
Copy link
Owner

doe300 commented Nov 3, 2022

I never built the projects with Ninja. From the error it looks like some dependency is not known to or correctly handled by CMake...
If this error happens under Make, then simply running make twice should also fix it.

@illwieckz
Copy link
Author

illwieckz commented Nov 3, 2022

Yeah, basically the problem seems to be that Ninja expects the libcpplog-static.a target to be built before starting to build, while it is built as part of the build process…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants