Skip to content
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

Set compiler.cstd in host profile #664

Open
wants to merge 1 commit into
base: develop2
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion conan_provider.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

set(CONAN_MINIMUM_VERSION 2.0.5)
set(CONAN_MINIMUM_VERSION 2.4.0)

# Create a new policy scope and set the minimum required cmake version so the
# features behind a policy setting like if(... IN_LIST ...) behaves as expected
Expand Down Expand Up @@ -128,6 +128,14 @@ function(detect_arch arch)
endfunction()


function(detect_c_standard c_standard)
set(${c_standard} ${CMAKE_C_STANDARD} PARENT_SCOPE)
if(CMAKE_C_EXTENSIONS)
set(${c_standard} "gnu${CMAKE_C_STANDARD}" PARENT_SCOPE)
endif()
endfunction()


function(detect_cxx_standard cxx_standard)
set(${cxx_standard} ${CMAKE_CXX_STANDARD} PARENT_SCOPE)
if(CMAKE_CXX_EXTENSIONS)
Expand Down Expand Up @@ -363,6 +371,7 @@ function(detect_host_profile output_file)
detect_os(os os_api_level os_sdk os_subsystem os_version)
detect_arch(arch)
detect_compiler(compiler compiler_version compiler_runtime compiler_runtime_type)
detect_c_standard(compiler_cstd)
detect_cxx_standard(compiler_cppstd)
detect_lib_cxx(compiler_libcxx)
detect_build_type(build_type)
Expand Down Expand Up @@ -399,6 +408,9 @@ function(detect_host_profile output_file)
if(compiler_runtime_type)
string(APPEND profile compiler.runtime_type=${compiler_runtime_type} "\n")
endif()
if(compiler_cstd)
string(APPEND profile compiler.cstd=${compiler_cstd} "\n")
endif()
if(compiler_cppstd)
string(APPEND profile compiler.cppstd=${compiler_cppstd} "\n")
endif()
Expand Down
Loading