Skip to content
This repository was archived by the owner on Feb 9, 2021. It is now read-only.
This repository was archived by the owner on Feb 9, 2021. It is now read-only.

CMake isn't using configured compiler #10

@bryceschober

Description

@bryceschober

Trying to use non-default gcc-7 on Ubuntu 14.04, it uses the default instead and fails with an error:

$ conan create -s compiler.version=7.3 .. cpputest/test
Exporting package recipe
CppUTest/master@cpputest/test: A new conanfile.py version was exported
CppUTest/master@cpputest/test: Folder: /home/bschober/.conan/data/CppUTest/master/cpputest/test/export
Configuration:
[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=7.3
compiler.libcxx=libstdc++
build_type=Release
[options]
[build_requires]
[env]

...

CppUTest/master@cpputest/test: Copying sources to build folder
CppUTest/master@cpputest/test: Generator txt created conanbuildinfo.txt
CppUTest/master@cpputest/test: Calling build()
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works

...

-------------------------------------------------------
CppUTest Version 3.8

Current compiler options:
    CC:                                 /usr/bin/cc
    CXX:                                /usr/bin/c++

...

CppUTest/master@cpputest/test (test package): Generator cmake created conanbuildinfo.cmake
CppUTest/master@cpputest/test (test package): Generator txt created conanbuildinfo.txt
CppUTest/master@cpputest/test (test package): Generated conaninfo.txt
CppUTest/master@cpputest/test (test package): Running build()
-- The CXX compiler identification is GNU 4.8.5
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: called by CMake conan helper
-- Conan: Compiler GCC>=5, checking major version 7.3
-- Conan: Checking correct version: 4.8
CMake Error at build/f903b28b40a2bcdd4a89871fc41d46a21bbd9fa9/conanbuildinfo.cmake:352 (message):
  Incorrect 'gcc' version 'compiler.version=7.3' is not the one detected by
  CMake: 'GNU=4.8'
Call Stack (most recent call first):
  build/f903b28b40a2bcdd4a89871fc41d46a21bbd9fa9/conanbuildinfo.cmake:404 (conan_error_compiler_version)
  build/f903b28b40a2bcdd4a89871fc41d46a21bbd9fa9/conanbuildinfo.cmake:480 (check_compiler_version)
  build/f903b28b40a2bcdd4a89871fc41d46a21bbd9fa9/conanbuildinfo.cmake:117 (conan_check_compiler)
  CMakeLists.txt:5 (conan_basic_setup)

-- Configuring incomplete, errors occurred!

So it looks like the cmake integration didn't pick up the correct compiler version from the conan configuration, and it just used the system-default gcc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions