-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17035 from benesch/libroach
storage/engine: extract static library to fix windows ccl builds
- Loading branch information
Showing
43 changed files
with
165 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Bump the version below when changing libroach CMake flags. Search for "BUILD | ||
ARTIFACT CACHING" in build/common.mk for rationale. | ||
|
||
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Copyright 2017 The Cockroach Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | ||
# implied. See the License for the specific language governing | ||
# permissions and limitations under the License. | ||
# | ||
# Author: Nikhil Benesch ([email protected]) | ||
|
||
# NB: Despite CMake's portability, this build configuration makes no attempt to | ||
# support non-GCC-like compilers. | ||
|
||
# The CXX_STANDARD property was introduced in version 3.1. | ||
cmake_minimum_required(VERSION 3.1 FATAL_ERROR) | ||
|
||
project(roachlib) | ||
|
||
add_library(roach | ||
db.cc | ||
encoding.cc | ||
eventlistener.cc | ||
protos/cockroach/pkg/roachpb/data.pb.cc | ||
protos/cockroach/pkg/roachpb/internal.pb.cc | ||
protos/cockroach/pkg/roachpb/metadata.pb.cc | ||
protos/cockroach/pkg/storage/engine/enginepb/mvcc.pb.cc | ||
protos/cockroach/pkg/storage/engine/enginepb/rocksdb.pb.cc | ||
protos/cockroach/pkg/util/hlc/timestamp.pb.cc | ||
protos/cockroach/pkg/util/unresolved_addr.pb.cc | ||
) | ||
target_include_directories(roach | ||
PUBLIC ./include | ||
PRIVATE ../protobuf/src ../rocksdb/include protos | ||
) | ||
|
||
add_library(roachccl | ||
ccl/db.cc | ||
) | ||
target_include_directories(roachccl | ||
PRIVATE ../rocksdb/include | ||
) | ||
target_link_libraries(roachccl roach) | ||
|
||
set_target_properties(roach roachccl PROPERTIES | ||
CXX_STANDARD 11 | ||
CXX_STANDARD_REQUIRED YES | ||
CXX_EXTENSIONS NO | ||
COMPILE_OPTIONS "-Werror;-Wall;-Wno-sign-compare" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Cockroach Community License (ccl) Functionality | ||
This tree houses our non-Apache2 licensed C++ code. | ||
|
||
Go CCL code lives in [pkg/ccl](/pkg/ccl). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,11 +14,11 @@ | |
// | ||
// Author: Daniel Harrison ([email protected]) | ||
|
||
#include "db.h" | ||
#include "rocksdb/iterator.h" | ||
#include "rocksdb/comparator.h" | ||
#include "rocksdb/write_batch.h" | ||
#include "rocksdb/write_batch_base.h" | ||
#include <rocksdb/iterator.h> | ||
#include <rocksdb/comparator.h> | ||
#include <rocksdb/write_batch.h> | ||
#include <rocksdb/write_batch_base.h> | ||
#include <libroach.h> | ||
|
||
// ToString returns a c++ string with the contents of a DBSlice. | ||
std::string ToString(DBSlice s); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,8 +14,8 @@ | |
// | ||
// Author: Peter Mattis ([email protected]) | ||
|
||
#ifndef ROACHLIB_DB_H | ||
#define ROACHLIB_DB_H | ||
#ifndef LIBROACH_H | ||
#define LIBROACH_H | ||
|
||
#include <stdbool.h> | ||
#include <stddef.h> | ||
|
@@ -295,8 +295,4 @@ DBStatus DBEnvWriteFile(DBEngine* db, DBSlice path, DBSlice contents); | |
} // extern "C" | ||
#endif | ||
|
||
#endif // ROACHLIB_DB_H | ||
|
||
// local variables: | ||
// mode: c++ | ||
// end: | ||
#endif // LIBROACH_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
# Cockroach Community License (ccl) Functionality | ||
This tree is intended to house the bulk of our non-Apache2 licensed packages. | ||
By convention, all packages under this tree have the suffix `ccl`. | ||
This tree is intended to house our non-Apache2 licensed Go packages. By | ||
convention, all packages under this tree have the suffix `ccl`. | ||
|
||
Grouping CCL packages into one tree and clearly labeling all CCL packages | ||
with a recognizable suffix will hopefully make it easier to identify and prevent | ||
introducing any accidental dependencies on ccl from Apache2 packages. | ||
|
||
C++ CCL code lives in [c-deps/libroach/ccl](/c-deps/libroach/ccl). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Since we link against C++ libraries, like RocksDB and libroach, we need to | ||
// link against the C++ standard library. This presence of this file convinces | ||
// cgo to link this package using the C++ compiler instead of the C compiler, | ||
// which brings in the appropriate, platform-specific C++ library (e.g., libc++ | ||
// on macOS or libstdc++ on Linux). |
Oops, something went wrong.