diff options
author | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-03-25 15:23:32 +0300 |
---|---|---|
committer | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-03-25 15:23:32 +0300 |
commit | 33669c796a33523ead0983331e85d192bb460bfb (patch) | |
tree | d0e30755698923df0a7b8a9b99e501ac057214ce /cmake | |
parent | fbc1b1eba4b5a74996651d255f4f286d0ed7c208 (diff) | |
download | ydb-33669c796a33523ead0983331e85d192bb460bfb.tar.gz |
intermediate changes
ref:84de00009e51ecf595c13dfc2c9846069069605d
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/conan.cmake | 20 | ||||
-rw-r--r-- | cmake/protobuf.cmake | 17 |
2 files changed, 28 insertions, 9 deletions
diff --git a/cmake/conan.cmake b/cmake/conan.cmake index 662c71a872..7254847363 100644 --- a/cmake/conan.cmake +++ b/cmake/conan.cmake @@ -33,7 +33,7 @@ # but it is only necessary on the end-user side. It is not necessary to create conan # packages, in fact it shouldn't be use for that. Check the project documentation. -# version: 0.16.1 +# version: 0.17.0 include(CMakeParseArguments) @@ -55,6 +55,8 @@ function(_get_msvc_ide_version result) set(${result} 15 PARENT_SCOPE) elseif(NOT MSVC_VERSION VERSION_LESS 1920 AND MSVC_VERSION VERSION_LESS 1930) set(${result} 16 PARENT_SCOPE) + elseif(NOT MSVC_VERSION VERSION_LESS 1930 AND MSVC_VERSION VERSION_LESS 1940) + set(${result} 17 PARENT_SCOPE) else() message(FATAL_ERROR "Conan: Unknown MSVC compiler version [${MSVC_VERSION}]") endif() @@ -126,6 +128,10 @@ macro(_conan_detect_compiler) set(_CONAN_SETTING_ARCH ${ARGUMENTS_ARCH}) endif() + if(USING_CXX) + set(_CONAN_SETTING_COMPILER_CPPSTD ${CMAKE_CXX_STANDARD}) + endif() + if (${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL GNU) # using GCC # TODO: Handle other params @@ -415,7 +421,8 @@ endfunction() function(_collect_settings result) set(ARGUMENTS_PROFILE_AUTO arch build_type compiler compiler.version - compiler.runtime compiler.libcxx compiler.toolset) + compiler.runtime compiler.libcxx compiler.toolset + compiler.cppstd) foreach(ARG ${ARGUMENTS_PROFILE_AUTO}) string(TOUPPER ${ARG} _arg_name) string(REPLACE "." "_" _arg_name ${_arg_name}) @@ -427,10 +434,10 @@ function(_collect_settings result) endfunction() function(conan_cmake_autodetect detected_settings) - _conan_detect_build_type() + _conan_detect_build_type(${ARGV}) _conan_check_system_name() _conan_check_language() - _conan_detect_compiler() + _conan_detect_compiler(${ARGV}) _collect_settings(collected_settings) set(${detected_settings} ${collected_settings} PARENT_SCOPE) endfunction() @@ -807,7 +814,8 @@ macro(conan_check) endif() if(NOT CONAN_DETECT_QUIET) - message(STATUS "Conan: Version found ${CONAN_VERSION_OUTPUT}") + string(STRIP "${CONAN_VERSION_OUTPUT}" _CONAN_VERSION_OUTPUT) + message(STATUS "Conan: Version found ${_CONAN_VERSION_OUTPUT}") endif() if(DEFINED CONAN_VERSION) @@ -837,7 +845,7 @@ function(conan_add_remote) if(DEFINED CONAN_COMMAND) set(CONAN_CMD ${CONAN_COMMAND}) else() - conan_check(REQUIRED) + conan_check(REQUIRED DETECT_QUIET) endif() set(CONAN_VERIFY_SSL_ARG "True") if(DEFINED CONAN_VERIFY_SSL) diff --git a/cmake/protobuf.cmake b/cmake/protobuf.cmake index fce76a3cc0..017b9d9a46 100644 --- a/cmake/protobuf.cmake +++ b/cmake/protobuf.cmake @@ -7,6 +7,18 @@ function(target_proto_plugin Tgt Name PluginTarget) ) endfunction() +function(target_proto_addincls Tgt) + set_property(TARGET ${Tgt} APPEND PROPERTY + PROTO_ADDINCL ${ARGN} + ) +endfunction() + +function(target_proto_outs Tgt) + set_property(TARGET ${Tgt} APPEND PROPERTY + PROTO_OUTS ${ARGN} + ) +endfunction() + function(target_proto_messages Tgt Scope) get_property(ProtocExtraOutsSuf TARGET ${Tgt} PROPERTY PROTOC_EXTRA_OUTS) foreach(proto ${ARGN}) @@ -27,9 +39,8 @@ function(target_proto_messages Tgt Scope) ${ProtocExtraOuts} COMMAND protoc ${COMMON_PROTOC_FLAGS} - -I=${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src - --cpp_out=${CMAKE_BINARY_DIR} - --cpp_styleguide_out=${CMAKE_BINARY_DIR} + "-I$<JOIN:$<TARGET_GENEX_EVAL:${Tgt},$<TARGET_PROPERTY:${Tgt},PROTO_ADDINCL>>,;-I>" + "$<JOIN:$<TARGET_GENEX_EVAL:${Tgt},$<TARGET_PROPERTY:${Tgt},PROTO_OUTS>>,;>" --plugin=protoc-gen-cpp_styleguide=${CMAKE_BINARY_DIR}/contrib/tools/protoc/plugins/cpp_styleguide/cpp_styleguide "$<JOIN:$<TARGET_GENEX_EVAL:${Tgt},$<TARGET_PROPERTY:${Tgt},PROTOC_OPTS>>,;>" ${protoRel} |