Skip to content

disable cmake compiler check language=None - #4276

Merged
memsharded merged 3 commits into
conan-io:developfrom
memsharded:feature/disable_cmake_compiler_check
Jan 16, 2019
Merged

memsharded merged 3 commits into
conan-io:developfrom
memsharded:feature/disable_cmake_compiler_check

Conversation

@memsharded

Copy link
Copy Markdown
Member

Changelog: Bugfix: conanbuildinfo.cmake won't fail if project() LANGUAGE is None, but the user defines CONAN_DISABLE_CHECK_COMPILER.

Docs: Omit

Close #4268

@ghost ghost assigned memsharded Jan 10, 2019
@ghost ghost added the stage: review label Jan 10, 2019
@memsharded memsharded added this to the 1.12 milestone Jan 10, 2019
@memsharded memsharded assigned lasote and unassigned memsharded Jan 10, 2019
@ghost ghost assigned memsharded Jan 11, 2019
conan_message(STATUS "WARN: Disabled conan compiler checks")
return()
endif()
if(NOT DEFINED CMAKE_CXX_COMPILER_ID)

@SSE4 SSE4 Jan 13, 2019

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose we also have to check ENABLED_LANGUAGES property (obviously, after the CONAN_DISABLE_CHECK_COMPILER check)

(to obtain a list use get_property(languages GLOBAL PROPERTY ENABLED_LANGUAGES))

and execute checks only if it has C or CXX in the list (potentially, also Objective-C and Objective-C++?),

otherwise skip (no language at all / Fortran / D / Rust / Go / C# / Whatever else)

see also:
https://cmake.org/cmake/help/v3.3/command/project.htm
https://cmake.org/cmake/help/v3.3/prop_gbl/ENABLED_LANGUAGES.html

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that if someone is using conan for those languages, they are already setting CONAN_DISABLE_CHECK_COMPILER. And if for some other reason the language is not set, maybe it is better to raise an error early.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, raising an error might be a good strategy in this case.

@memsharded
memsharded merged commit a707730 into conan-io:develop Jan 16, 2019
@memsharded
memsharded deleted the feature/disable_cmake_compiler_check branch January 16, 2019 16:07
@ghost ghost removed the stage: review label Jan 16, 2019
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

Successfully merging this pull request may close these issues.

Disable conan checking compiler comes after compiler if statement in conanbuildinfo

3 participants