Closed xiedeacc closed 2 years ago
This can be tricky to identify but could mean a configuration error. The CMake
action was successful but it didn't produce a particular output the rule was configured to expect. CMake logs might reveal more.
This can be tricky to identify but could mean a configuration error. The
CMake
action was successful but it didn't produce a particular output the rule was configured to expect. CMake logs might reveal more.
I have proviede a very tiny project to reproduce this prolem, can you figure out which configuration problem? I notice output library file was generated in BUILD_TMPDIR in my project, but demo nothing generated
It seems the CMake target SMHasherSupport
does not actually produce libSMHasherSupport.a
. One of my favorite tricks is to set postfix_script = "tree . ; exit 1"
on my targets and inspect what's actually being produced. Perhaps give that a try (note you may need to install the tree
command on your system)?
It seems the CMake target
SMHasherSupport
does not actually producelibSMHasherSupport.a
. One of my favorite tricks is to setpostfix_script = "tree . ; exit 1"
on my targets and inspect what's actually being produced. Perhaps give that a try (note you may need to install thetree
command on your system)?
use postfix_script show it really produce a libSMHasherSupport.a, but I cannot find any direcotry named sandbox under bazel out directory, was this problem?
Not all CMake projects correctly setup their install targets. This means when cmake install
runs, the build artifacts aren't actually moved into the correct location. Unfortunately the fix for this is to either update the CMake files to define install targets or use postfix_script
to do some extra copying of files to the location Bazel expects.
Not all CMake projects correctly setup their install targets. This means when
cmake install
runs, the build artifacts aren't actually moved into the correct location. Unfortunately the fix for this is to either update the CMake files to define install targets or usepostfix_script
to do some extra copying of files to the location Bazel expects.
ok, I try fix it
fixed by add install directive in cmake
rules_foreign_cc cmake rule said output xxx.a was not created, but CMake.log display all success bazel version: 5.1.0 compile from source use oracle jdk11
build log
CMake.log
here was demo:
https://github.com/xiedeacc/bazel_cmake_demo.git
here was build file
with postfix_script = "tree . ; exit 1"