-
Notifications
You must be signed in to change notification settings - Fork 34
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
Using CMake-codecov with $<TARGET_OBJECTS:xxxxxxxx> #11
Comments
Unfortunately I didn't find a way to find the linker and compiler to be used this early at configuration time, so I needed to get these by the list of source files. The my_test_prog target doesn't have any source files in its sources list, so However, |
@Gjacquenot I can't reproduce your log. First I needed to change the code to get it working with CMake 3.8.2: --- ../foo.txt 2017-07-21 17:20:42.000000000 +0200
+++ ../CMakeLists.txt 2017-07-21 17:21:40.000000000 +0200
@@ -1,6 +1,9 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
PROJECT(hello_world)
-IF(NOT DEFINED CMAKE_BUILD_TYPE)
+IF(POLICY CMP0051)
+ cmake_policy(SET CMP0051 NEW)
+ENDIF()
+IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Coverage)
ENDIF()
STRING(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_UPPER) Then I've run CMake:
As you can see I get the right output for the search of the right compiler flag and |
@alehaa, thanks for your quick answer. Sorry, I did not use the latest version of your repository, this is why we obtain different log messages. However, you face the same disabling warning on target. Wouldn't it be possible to obtain compiler information from another method, or use a default value in case of failure? |
My fault, sorry. I think some time ago CMake itself didn't know how to handle targets with object libraries as only sources. There are two problems:
However, I'm thinking about an optional parameter named |
I am facing a
Coverage disabled
warning while trying to useCMake-codecov
.I am building executable with
TARGET_OBJECTS
option, that preventCMake-codecov
to discover the language used. The internal variableNUM_COMPILERS
is equal to zero inFindcodecov.cmake
. Would it be possible to investigate this development?Below is a CMakeLists.txt, that repoduces the problem (one needs to have
codecov
available toCMake
)The log is here
Guillaume
The text was updated successfully, but these errors were encountered: