Browse Source

DTCC-822 Put double-conversion under yamaker

ref:50f8b947dedd3183d21db08bf8ab226bb09535d1
shadchin 3 years ago
parent
commit
4275779551

+ 3 - 0
CMakeLists.txt

@@ -4,6 +4,9 @@ project(YDB LANGUAGES C CXX ASM)
 set(BUILD_SHARED_LIBS Off)
 set(CMAKE_CXX_STANDARD 20)
 set(CMAKE_CXX_EXTENSIONS Off)
+set(YDB_MAX_LINK_JOBS 5 CACHE STRING "Maximum parallel link jobs for Ninja generator")
+set_property(GLOBAL PROPERTY JOB_POOLS link_jobs=${YDB_MAX_LINK_JOBS})
+set(CMAKE_JOB_POOL_LINK link_jobs)
 set(CMAKE_C_FLAGS "\
   -m64 \
   -g \

+ 2 - 1
cmake/bison.cmake

@@ -1,6 +1,6 @@
 function(target_bison_parser Tgt Scope)
   foreach(arg ${ARGN})
-    file(REAL_PATH ${arg} argPath)
+    get_filename_component(argPath ${arg} REALPATH)
     if (argPath MATCHES "${CMAKE_SOURCE_DIR}/.*")
       file(RELATIVE_PATH argRel ${CMAKE_CURRENT_SOURCE_DIR} ${argPath})
       string(REPLACE ".." "__" ArgInBindir ${argRel})
@@ -12,6 +12,7 @@ function(target_bison_parser Tgt Scope)
     get_filename_component(OutputDir ${ArgInBindir} DIRECTORY)
     add_custom_command(
       OUTPUT ${OutputDir}/${OutputBase}.cpp ${OutputDir}/${OutputBase}.h
+      COMMAND ${CMAKE_COMMAND} -E make_directory ${OutputDir}
       COMMAND ${CMAKE_BINARY_DIR}/bin/bison/bin/bison ${BISON_FLAGS} -v --defines=${OutputDir}/${OutputBase}.h -o ${OutputDir}/${OutputBase}.cpp ${arg}
       DEPENDS ${arg}
     )

+ 6 - 4
cmake/protobuf.cmake

@@ -10,10 +10,10 @@ endfunction()
 function(target_proto_messages Tgt Scope)
   get_property(ProtocExtraOutsSuf TARGET ${Tgt} PROPERTY PROTOC_EXTRA_OUTS)
   foreach(proto ${ARGN})
-    if (proto MATCHES ${CMAKE_SOURCE_DIR})
-      file(RELATIVE_PATH protoRel ${CMAKE_SOURCE_DIR} ${proto})
-    elseif(proto MATCHES ${CMAKE_BINARY_DIR})
+    if(proto MATCHES ${CMAKE_BINARY_DIR})
       file(RELATIVE_PATH protoRel ${CMAKE_BINARY_DIR} ${proto})
+    elseif (proto MATCHES ${CMAKE_SOURCE_DIR})
+      file(RELATIVE_PATH protoRel ${CMAKE_SOURCE_DIR} ${proto})
     else()
       set(protoRel ${proto})
     endif()
@@ -29,9 +29,11 @@ function(target_proto_messages Tgt Scope)
           ${COMMON_PROTOC_FLAGS}
           -I=${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src
           --cpp_out=${CMAKE_BINARY_DIR}
+          --cpp_styleguide_out=${CMAKE_BINARY_DIR}
+          --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}
-        DEPENDS ${proto} $<TARGET_PROPERTY:${Tgt},PROTOC_DEPS>
+        DEPENDS ${proto} $<TARGET_PROPERTY:${Tgt},PROTOC_DEPS> ${CMAKE_BINARY_DIR}/contrib/tools/protoc/plugins/cpp_styleguide/cpp_styleguide
         WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
         COMMAND_EXPAND_LISTS
     )

+ 1 - 1
contrib/libs/apache/arrow/cpp/src/arrow/util/double_conversion.h

@@ -17,7 +17,7 @@
 
 #pragma once
 
-#include "contrib/libs/double-conversion/double-conversion.h"  // IWYU pragma: export
+#include "contrib/libs/double-conversion/double-conversion/double-conversion.h"  // IWYU pragma: export
 
 namespace arrow {
 namespace util {

+ 19 - 18
contrib/libs/double-conversion/.yandex_meta/devtools.copyrights.report

@@ -38,9 +38,9 @@ BELONGS ya.make
         Score           : 100.00
         Match type      : COPYRIGHT
     Files with this license:
-        double-conversion.h [1:1]
-        fast-dtoa.cc [1:1]
-        ieee.h [1:1]
+        double-conversion/double-conversion.h [1:1]
+        double-conversion/fast-dtoa.cc [1:1]
+        double-conversion/ieee.h [1:1]
 
 KEEP     COPYRIGHT_SERVICE_LABEL 16d77374d4f3ba25a3fdfa4958bf4c49
 BELONGS ya.make
@@ -51,6 +51,7 @@ BELONGS ya.make
         Score           : 100.00
         Match type      : COPYRIGHT
     Files with this license:
+        COPYING [1:1]
         LICENSE [1:1]
 
 KEEP     COPYRIGHT_SERVICE_LABEL 3666116ac4f173e889ce41ac8ed171ca
@@ -62,7 +63,7 @@ BELONGS ya.make
         Score           : 100.00
         Match type      : COPYRIGHT
     Files with this license:
-        cached-powers.cc [1:1]
+        double-conversion/cached-powers.cc [1:1]
 
 KEEP     COPYRIGHT_SERVICE_LABEL 54a59bbade65e8a194ed76f4af30de25
 BELONGS ya.make
@@ -73,17 +74,17 @@ BELONGS ya.make
         Score           : 100.00
         Match type      : COPYRIGHT
     Files with this license:
-        bignum-dtoa.cc [1:1]
-        bignum-dtoa.h [1:1]
-        bignum.cc [1:1]
-        bignum.h [1:1]
-        cached-powers.h [1:1]
-        diy-fp.cc [1:1]
-        diy-fp.h [1:1]
-        double-conversion.cc [1:1]
-        fast-dtoa.h [1:1]
-        fixed-dtoa.cc [1:1]
-        fixed-dtoa.h [1:1]
-        strtod.cc [1:1]
-        strtod.h [1:1]
-        utils.h [1:1]
+        double-conversion/bignum-dtoa.cc [1:1]
+        double-conversion/bignum-dtoa.h [1:1]
+        double-conversion/bignum.cc [1:1]
+        double-conversion/bignum.h [1:1]
+        double-conversion/cached-powers.h [1:1]
+        double-conversion/diy-fp.cc [1:1]
+        double-conversion/diy-fp.h [1:1]
+        double-conversion/double-conversion.cc [1:1]
+        double-conversion/fast-dtoa.h [1:1]
+        double-conversion/fixed-dtoa.cc [1:1]
+        double-conversion/fixed-dtoa.h [1:1]
+        double-conversion/strtod.cc [1:1]
+        double-conversion/strtod.h [1:1]
+        double-conversion/utils.h [1:1]

+ 19 - 18
contrib/libs/double-conversion/.yandex_meta/devtools.licenses.report

@@ -38,6 +38,7 @@ BELONGS ya.make
         Match type      : TEXT
         Links           : http://www.opensource.org/licenses/BSD-3-Clause, https://spdx.org/licenses/BSD-3-Clause
     Files with this license:
+        COPYING [2:26]
         LICENSE [2:26]
 
 KEEP     BSD-3-Clause         f903ceb778f6db21bac728e4622abbd4
@@ -49,21 +50,21 @@ BELONGS ya.make
         Match type      : TEXT
         Links           : http://www.opensource.org/licenses/BSD-3-Clause, https://spdx.org/licenses/BSD-3-Clause
     Files with this license:
-        bignum-dtoa.cc [2:26]
-        bignum-dtoa.h [2:26]
-        bignum.cc [2:26]
-        bignum.h [2:26]
-        cached-powers.cc [2:26]
-        cached-powers.h [2:26]
-        diy-fp.cc [2:26]
-        diy-fp.h [2:26]
-        double-conversion.cc [2:26]
-        double-conversion.h [2:26]
-        fast-dtoa.cc [2:26]
-        fast-dtoa.h [2:26]
-        fixed-dtoa.cc [2:26]
-        fixed-dtoa.h [2:26]
-        ieee.h [2:26]
-        strtod.cc [2:26]
-        strtod.h [2:26]
-        utils.h [2:26]
+        double-conversion/bignum-dtoa.cc [2:26]
+        double-conversion/bignum-dtoa.h [2:26]
+        double-conversion/bignum.cc [2:26]
+        double-conversion/bignum.h [2:26]
+        double-conversion/cached-powers.cc [2:26]
+        double-conversion/cached-powers.h [2:26]
+        double-conversion/diy-fp.cc [2:26]
+        double-conversion/diy-fp.h [2:26]
+        double-conversion/double-conversion.cc [2:26]
+        double-conversion/double-conversion.h [2:26]
+        double-conversion/fast-dtoa.cc [2:26]
+        double-conversion/fast-dtoa.h [2:26]
+        double-conversion/fixed-dtoa.cc [2:26]
+        double-conversion/fixed-dtoa.h [2:26]
+        double-conversion/ieee.h [2:26]
+        double-conversion/strtod.cc [2:26]
+        double-conversion/strtod.h [2:26]
+        double-conversion/utils.h [2:26]

+ 14 - 0
contrib/libs/double-conversion/AUTHORS

@@ -0,0 +1,14 @@
+# Below is a list of people and organizations that have contributed
+# to the double-conversion project.  Names should be added to the
+# list like so:
+#
+#   Name/Organization <email address>
+
+Google Inc.
+Mozilla Foundation
+
+Jeff Muizelaar <jmuizelaar@mozilla.com>
+Mike Hommey <mhommey@mozilla.com>
+Martin Olsson <mnemo@minimum.se>
+Kent Williams <chaircrusher@gmail.com>
+Elan Ruusamäe <glen@delfi.ee>

+ 10 - 10
contrib/libs/double-conversion/CMakeLists.txt

@@ -1,20 +1,20 @@
 add_library(contrib-libs-double-conversion)
 target_include_directories(contrib-libs-double-conversion PUBLIC
-  ${CMAKE_SOURCE_DIR}/contrib/libs/double-conversion/include
+  ${CMAKE_SOURCE_DIR}/contrib/libs/double-conversion
 )
 target_include_directories(contrib-libs-double-conversion PRIVATE
-  ${CMAKE_SOURCE_DIR}/contrib/libs/double-conversion/include
+  ${CMAKE_SOURCE_DIR}/contrib/libs/double-conversion
 )
 target_link_libraries(contrib-libs-double-conversion PUBLIC
   contrib-libs-cxxsupp
 )
 target_sources(contrib-libs-double-conversion PRIVATE
-  ${CMAKE_SOURCE_DIR}/contrib/libs/double-conversion/cached-powers.cc
-  ${CMAKE_SOURCE_DIR}/contrib/libs/double-conversion/bignum-dtoa.cc
-  ${CMAKE_SOURCE_DIR}/contrib/libs/double-conversion/double-conversion.cc
-  ${CMAKE_SOURCE_DIR}/contrib/libs/double-conversion/diy-fp.cc
-  ${CMAKE_SOURCE_DIR}/contrib/libs/double-conversion/fixed-dtoa.cc
-  ${CMAKE_SOURCE_DIR}/contrib/libs/double-conversion/strtod.cc
-  ${CMAKE_SOURCE_DIR}/contrib/libs/double-conversion/bignum.cc
-  ${CMAKE_SOURCE_DIR}/contrib/libs/double-conversion/fast-dtoa.cc
+  ${CMAKE_SOURCE_DIR}/contrib/libs/double-conversion/double-conversion/bignum-dtoa.cc
+  ${CMAKE_SOURCE_DIR}/contrib/libs/double-conversion/double-conversion/bignum.cc
+  ${CMAKE_SOURCE_DIR}/contrib/libs/double-conversion/double-conversion/cached-powers.cc
+  ${CMAKE_SOURCE_DIR}/contrib/libs/double-conversion/double-conversion/diy-fp.cc
+  ${CMAKE_SOURCE_DIR}/contrib/libs/double-conversion/double-conversion/double-conversion.cc
+  ${CMAKE_SOURCE_DIR}/contrib/libs/double-conversion/double-conversion/fast-dtoa.cc
+  ${CMAKE_SOURCE_DIR}/contrib/libs/double-conversion/double-conversion/fixed-dtoa.cc
+  ${CMAKE_SOURCE_DIR}/contrib/libs/double-conversion/double-conversion/strtod.cc
 )

+ 26 - 0
contrib/libs/double-conversion/COPYING

@@ -0,0 +1,26 @@
+Copyright 2006-2011, the V8 project authors. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+    * Neither the name of Google Inc. nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ 54 - 0
contrib/libs/double-conversion/README.md

@@ -0,0 +1,54 @@
+https://github.com/google/double-conversion
+
+This project (double-conversion) provides binary-decimal and decimal-binary
+routines for IEEE doubles.
+
+The library consists of efficient conversion routines that have been extracted
+from the V8 JavaScript engine. The code has been refactored and improved so that
+it can be used more easily in other projects.
+
+There is extensive documentation in `double-conversion/double-conversion.h`. Other 
+examples can be found in `test/cctest/test-conversions.cc`.
+
+
+Building
+========
+
+This library can be built with [scons][0] or [cmake][1].
+The checked-in Makefile simply forwards to scons, and provides a
+shortcut to run all tests:
+
+    make
+    make test
+
+Scons
+-----
+
+The easiest way to install this library is to use `scons`. It builds
+the static and shared library, and is set up to install those at the
+correct locations:
+
+    scons install
+
+Use the `DESTDIR` option to change the target directory:
+
+    scons DESTDIR=alternative_directory install
+
+Cmake
+-----
+
+To use cmake run `cmake .` in the root directory. This overwrites the
+existing Makefile.
+
+Use `-DBUILD_SHARED_LIBS=ON` to enable the compilation of shared libraries.
+Note that this disables static libraries. There is currently no way to
+build both libraries at the same time with cmake.
+
+Use `-DBUILD_TESTING=ON` to build the test executable.
+
+    cmake . -DBUILD_TESTING=ON
+    make
+    test/cctest/cctest --list | tr -d '<' | xargs test/cctest/cctest
+
+[0]: http://www.scons.org/
+[1]: https://cmake.org/

Some files were not shown because too many files changed in this diff