Skip to content

Commit

Permalink
Add rc compiler to compiler_executables (conan-io#632)
Browse files Browse the repository at this point in the history
* rc compiler

---------

Co-authored-by: Luis Caro Campos <[email protected]>
  • Loading branch information
memsharded and jcar87 authored Jul 12, 2024
1 parent eba63de commit 8bf396b
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions conan_provider.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -323,26 +323,37 @@ 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.")
endif()
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()


Expand Down

0 comments on commit 8bf396b

Please sign in to comment.