diff --git a/conan_provider.cmake b/conan_provider.cmake index cba4606c..c6d6ba78 100644 --- a/conan_provider.cmake +++ b/conan_provider.cmake @@ -289,9 +289,12 @@ endmacro() macro(append_compiler_executables_configuration) set(_conan_c_compiler "") set(_conan_cpp_compiler "") + set(_conan_rc_compiler "") + set(_conan_compilers_list "") if(CMAKE_C_COMPILER) - set(_conan_c_compiler "\"c\":\"${CMAKE_C_COMPILER}\",") + set(_conan_c_compiler "\"c\":\"${CMAKE_C_COMPILER}\"") set_conan_compiler_if_appleclang(C cc _conan_c_compiler) + list(APPEND _conan_compilers_list ${_conan_c_compiler}) else() message(WARNING "CMake-Conan: The C compiler is not defined. " "Please define CMAKE_C_COMPILER or enable the C language.") @@ -299,16 +302,24 @@ macro(append_compiler_executables_configuration) if(CMAKE_CXX_COMPILER) set(_conan_cpp_compiler "\"cpp\":\"${CMAKE_CXX_COMPILER}\"") set_conan_compiler_if_appleclang(CXX c++ _conan_cpp_compiler) + list(APPEND _conan_compilers_list ${_conan_cpp_compiler}) else() message(WARNING "CMake-Conan: The C++ compiler is not defined. " "Please define CMAKE_CXX_COMPILER or enable the C++ language.") endif() - - if(NOT "x${_conan_c_compiler}${_conan_cpp_compiler}" STREQUAL "x") - string(APPEND PROFILE "tools.build:compiler_executables={${_conan_c_compiler}${_conan_cpp_compiler}}\n") + if(CMAKE_RC_COMPILER) + set(_conan_rc_compiler "\"rc\":\"${CMAKE_RC_COMPILER}\"") + list(APPEND _conan_compilers_list ${_conan_rc_compiler}) + # Not necessary to warn if RC not defined + endif() + if(NOT "x${_conan_compilers_list}" STREQUAL "x") + string(REPLACE ";" "," _conan_compilers_list "${_conan_compilers_list}") + string(APPEND PROFILE "tools.build:compiler_executables={${_conan_compilers_list}}\n") endif() unset(_conan_c_compiler) unset(_conan_cpp_compiler) + unset(_conan_rc_compiler) + unset(_conan_compilers_list) endmacro()