There is a workaround about this issue:

Create the binary_dir (build) outside the source_dir!
Than every path to source files are absolute ;-)

i.e.:
clausklein$ make -n check
mkdir -p ../.build-samples-Debug
cd ../.build-samples-Debug && cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug 
-DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON 
-DCMAKE_CXX_COMPILER=/opt/local/bin/clang++ 
/Users/clausklein/Workspace/cpp/samples
ln -sf 
/Users/clausklein/Workspace/cpp/samples/../.build-samples-Debug/compile_commands.json
 .
run-clang-tidy.py -header-filter='/Users/clausklein/Workspace/cpp/samples/.*' 
-checks='-*,misc-*,boost-*,cert-*,-misc-unused-parameters' | tee 
run-clang-tidy.log 2>&1
egrep '\b(warning|error):' run-clang-tidy.log | perl -pe 's/(^.*) 
(warning|error):/\2/' | sort -u
clausklein$ 


-Claus

> Am 23.07.2019 um 13:03 schrieb Brad King <brad.k...@kitware.com>:
> 
> On 7/22/19 4:47 PM, Claus Klein wrote:
>> Than I realized , the ninja.rules files contains NO absolute paths
>> to target source and header files.
> 
> Historically the Ninja ecosystem encourages use of relative paths.
> There is an issue for this in CMake:
> 
>  https://gitlab.kitware.com/cmake/cmake/issues/13894#note_233789
> 
> and fixing it correctly depends on fixing another issue in Ninja:
> 
>  https://github.com/ninja-build/ninja/issues/1251
> 
> -Brad

-- 

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:
https://cmake.org/mailman/listinfo/cmake-developers

Reply via email to