Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 10 additions & 8 deletions generator/internal/scaffold_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,9 @@ void GenerateQuickstartCMake(
cmake_minimum_required(VERSION 3.22...3.31)
project(google-cloud-cpp-$library$-quickstart CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(google_cloud_cpp_$library$ REQUIRED)

# MSVC requires some additional code to select the correct runtime library
Expand Down Expand Up @@ -1062,7 +1065,7 @@ void GenerateQuickstartMakefile(
# The CXX, CXXFLAGS and CXXLD variables are hard-coded. These values work for
# our tests, but applications would typically make them configurable parameters.
CXX=g++
CXXFLAGS=
CXXFLAGS=-std=c++17
CXXLD=$$(CXX)
BIN=.

Expand Down Expand Up @@ -1147,14 +1150,13 @@ void GenerateQuickstartBazelrc(
# Use host-OS-specific config lines from bazelrc files.
build --enable_platform_specific_config=true

# The project requires C++ >= 14. By default Bazel adds `-std=c++0x` which
# disables C++14 features, even if the compilers defaults to C++ >= 14
build:linux --cxxopt=-std=c++14
build:macos --cxxopt=-std=c++14
# Protobuf and gRPC require (or soon will require) C++14 to compile the "host"
# The project requires C++ >= 17.
build:linux --cxxopt=-std=c++17
build:macos --cxxopt=-std=c++17
# Protobuf and gRPC require (or soon will require) C++17 to compile the "host"
# targets, such as protoc and the grpc plugin.
build:linux --host_cxxopt=-std=c++14
build:macos --host_cxxopt=-std=c++14
build:linux --host_cxxopt=-std=c++17
build:macos --host_cxxopt=-std=c++17

# Do not create the convenience links. They are inconvenient when the build
# runs inside a docker image or if one builds a quickstart and then builds
Expand Down
4 changes: 4 additions & 0 deletions generator/internal/scaffold_generator_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ TEST_F(ScaffoldGenerator, QuickstartCMake) {
EXPECT_THAT(actual, HasSubstr("2034"));
EXPECT_THAT(actual, Not(HasSubstr("$copyright_year$")));
EXPECT_THAT(actual, Not(HasSubstr("$library_prefix$")));
EXPECT_THAT(actual, HasSubstr("CMAKE_CXX_STANDARD 17"));
}

TEST_F(ScaffoldGenerator, QuickstartMakefile) {
Expand All @@ -421,6 +422,7 @@ TEST_F(ScaffoldGenerator, QuickstartMakefile) {
EXPECT_THAT(actual, HasSubstr("2034"));
EXPECT_THAT(actual, Not(HasSubstr("$copyright_year$")));
EXPECT_THAT(actual, HasSubstr("\t$(CXXLD) "));
EXPECT_THAT(actual, HasSubstr("CXXFLAGS=-std=c++17"));
}

TEST_F(ScaffoldGenerator, QuickstartWorkspace) {
Expand Down Expand Up @@ -461,6 +463,8 @@ TEST_F(ScaffoldGenerator, QuickstartBazelrc) {
auto const actual = std::move(os).str();
EXPECT_THAT(actual, HasSubstr("2034"));
EXPECT_THAT(actual, Not(HasSubstr("$copyright_year$")));
EXPECT_THAT(actual, HasSubstr("c++17"));
EXPECT_THAT(actual, Not(HasSubstr("c++14")));
}

} // namespace
Expand Down
7 changes: 3 additions & 4 deletions google/cloud/accessapproval/quickstart/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
# Use host-OS-specific config lines from bazelrc files.
build --enable_platform_specific_config=true



# The project requires C++ >= 17.
build:linux --cxxopt=-std=c++17
build:macos --cxxopt=-std=c++17


# Protobuf and gRPC require (or soon will require) C++17 to compile the "host"
# targets, such as protoc and the grpc plugin.
build:linux --host_cxxopt=-std=c++17
build:macos --host_cxxopt=-std=c++17

Expand Down
3 changes: 3 additions & 0 deletions google/cloud/accessapproval/quickstart/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
cmake_minimum_required(VERSION 3.22...3.31)
project(google-cloud-cpp-accessapproval-quickstart CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(google_cloud_cpp_accessapproval REQUIRED)

# MSVC requires some additional code to select the correct runtime library
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/accessapproval/quickstart/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# The CXX, CXXFLAGS and CXXLD variables are hard-coded. These values work for
# our tests, but applications would typically make them configurable parameters.
CXX=g++
CXXFLAGS=
CXXFLAGS=-std=c++17
CXXLD=$(CXX)
BIN=.

Expand Down
7 changes: 3 additions & 4 deletions google/cloud/accesscontextmanager/quickstart/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
# Use host-OS-specific config lines from bazelrc files.
build --enable_platform_specific_config=true



# The project requires C++ >= 17.
build:linux --cxxopt=-std=c++17
build:macos --cxxopt=-std=c++17


# Protobuf and gRPC require (or soon will require) C++17 to compile the "host"
# targets, such as protoc and the grpc plugin.
build:linux --host_cxxopt=-std=c++17
build:macos --host_cxxopt=-std=c++17

Expand Down
3 changes: 3 additions & 0 deletions google/cloud/accesscontextmanager/quickstart/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
cmake_minimum_required(VERSION 3.22...3.31)
project(google-cloud-cpp-accesscontextmanager-quickstart CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(google_cloud_cpp_accesscontextmanager REQUIRED)

# MSVC requires some additional code to select the correct runtime library
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/accesscontextmanager/quickstart/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# The CXX, CXXFLAGS and CXXLD variables are hard-coded. These values work for
# our tests, but applications would typically make them configurable parameters.
CXX=g++
CXXFLAGS=
CXXFLAGS=-std=c++17
CXXLD=$(CXX)
BIN=.

Expand Down
7 changes: 3 additions & 4 deletions google/cloud/advisorynotifications/quickstart/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
# Use host-OS-specific config lines from bazelrc files.
build --enable_platform_specific_config=true



# The project requires C++ >= 17.
build:linux --cxxopt=-std=c++17
build:macos --cxxopt=-std=c++17


# Protobuf and gRPC require (or soon will require) C++17 to compile the "host"
# targets, such as protoc and the grpc plugin.
build:linux --host_cxxopt=-std=c++17
build:macos --host_cxxopt=-std=c++17

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
cmake_minimum_required(VERSION 3.22...3.31)
project(google-cloud-cpp-advisorynotifications-quickstart CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(google_cloud_cpp_advisorynotifications REQUIRED)

# MSVC requires some additional code to select the correct runtime library
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/advisorynotifications/quickstart/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# The CXX, CXXFLAGS and CXXLD variables are hard-coded. These values work for
# our tests, but applications would typically make them configurable parameters.
CXX=g++
CXXFLAGS=
CXXFLAGS=-std=c++17
CXXLD=$(CXX)
BIN=.

Expand Down
7 changes: 3 additions & 4 deletions google/cloud/aiplatform/quickstart/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
# Use host-OS-specific config lines from bazelrc files.
build --enable_platform_specific_config=true



# The project requires C++ >= 17.
build:linux --cxxopt=-std=c++17
build:macos --cxxopt=-std=c++17


# Protobuf and gRPC require (or soon will require) C++17 to compile the "host"
# targets, such as protoc and the grpc plugin.
build:linux --host_cxxopt=-std=c++17
build:macos --host_cxxopt=-std=c++17

Expand Down
3 changes: 3 additions & 0 deletions google/cloud/aiplatform/quickstart/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
cmake_minimum_required(VERSION 3.22...3.31)
project(google-cloud-cpp-aiplatform-quickstart CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(google_cloud_cpp_aiplatform REQUIRED)

# MSVC requires some additional code to select the correct runtime library
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/aiplatform/quickstart/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# The CXX, CXXFLAGS and CXXLD variables are hard-coded. These values work for
# our tests, but applications would typically make them configurable parameters.
CXX=g++
CXXFLAGS=
CXXFLAGS=-std=c++17
CXXLD=$(CXX)
BIN=.

Expand Down
7 changes: 3 additions & 4 deletions google/cloud/alloydb/quickstart/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
# Use host-OS-specific config lines from bazelrc files.
build --enable_platform_specific_config=true



# The project requires C++ >= 17.
build:linux --cxxopt=-std=c++17
build:macos --cxxopt=-std=c++17


# Protobuf and gRPC require (or soon will require) C++17 to compile the "host"
# targets, such as protoc and the grpc plugin.
build:linux --host_cxxopt=-std=c++17
build:macos --host_cxxopt=-std=c++17

Expand Down
3 changes: 3 additions & 0 deletions google/cloud/alloydb/quickstart/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
cmake_minimum_required(VERSION 3.22...3.31)
project(google-cloud-cpp-alloydb-quickstart CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(google_cloud_cpp_alloydb REQUIRED)

# MSVC requires some additional code to select the correct runtime library
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/alloydb/quickstart/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# The CXX, CXXFLAGS and CXXLD variables are hard-coded. These values work for
# our tests, but applications would typically make them configurable parameters.
CXX=g++
CXXFLAGS=
CXXFLAGS=-std=c++17
CXXLD=$(CXX)
BIN=.

Expand Down
7 changes: 3 additions & 4 deletions google/cloud/apigateway/quickstart/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
# Use host-OS-specific config lines from bazelrc files.
build --enable_platform_specific_config=true



# The project requires C++ >= 17.
build:linux --cxxopt=-std=c++17
build:macos --cxxopt=-std=c++17


# Protobuf and gRPC require (or soon will require) C++17 to compile the "host"
# targets, such as protoc and the grpc plugin.
build:linux --host_cxxopt=-std=c++17
build:macos --host_cxxopt=-std=c++17

Expand Down
3 changes: 3 additions & 0 deletions google/cloud/apigateway/quickstart/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
cmake_minimum_required(VERSION 3.22...3.31)
project(google-cloud-cpp-apigateway-quickstart CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(google_cloud_cpp_apigateway REQUIRED)

# MSVC requires some additional code to select the correct runtime library
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/apigateway/quickstart/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# The CXX, CXXFLAGS and CXXLD variables are hard-coded. These values work for
# our tests, but applications would typically make them configurable parameters.
CXX=g++
CXXFLAGS=
CXXFLAGS=-std=c++17
CXXLD=$(CXX)
BIN=.

Expand Down
7 changes: 3 additions & 4 deletions google/cloud/apigeeconnect/quickstart/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
# Use host-OS-specific config lines from bazelrc files.
build --enable_platform_specific_config=true



# The project requires C++ >= 17.
build:linux --cxxopt=-std=c++17
build:macos --cxxopt=-std=c++17


# Protobuf and gRPC require (or soon will require) C++17 to compile the "host"
# targets, such as protoc and the grpc plugin.
build:linux --host_cxxopt=-std=c++17
build:macos --host_cxxopt=-std=c++17

Expand Down
3 changes: 3 additions & 0 deletions google/cloud/apigeeconnect/quickstart/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
cmake_minimum_required(VERSION 3.22...3.31)
project(google-cloud-cpp-apigeeconnect-quickstart CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(google_cloud_cpp_apigeeconnect REQUIRED)

# MSVC requires some additional code to select the correct runtime library
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/apigeeconnect/quickstart/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# The CXX, CXXFLAGS and CXXLD variables are hard-coded. These values work for
# our tests, but applications would typically make them configurable parameters.
CXX=g++
CXXFLAGS=
CXXFLAGS=-std=c++17
CXXLD=$(CXX)
BIN=.

Expand Down
7 changes: 3 additions & 4 deletions google/cloud/apikeys/quickstart/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
# Use host-OS-specific config lines from bazelrc files.
build --enable_platform_specific_config=true



# The project requires C++ >= 17.
build:linux --cxxopt=-std=c++17
build:macos --cxxopt=-std=c++17


# Protobuf and gRPC require (or soon will require) C++17 to compile the "host"
# targets, such as protoc and the grpc plugin.
build:linux --host_cxxopt=-std=c++17
build:macos --host_cxxopt=-std=c++17

Expand Down
3 changes: 3 additions & 0 deletions google/cloud/apikeys/quickstart/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
cmake_minimum_required(VERSION 3.22...3.31)
project(google-cloud-cpp-apikeys-quickstart CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(google_cloud_cpp_apikeys REQUIRED)

# MSVC requires some additional code to select the correct runtime library
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/apikeys/quickstart/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# The CXX, CXXFLAGS and CXXLD variables are hard-coded. These values work for
# our tests, but applications would typically make them configurable parameters.
CXX=g++
CXXFLAGS=
CXXFLAGS=-std=c++17
CXXLD=$(CXX)
BIN=.

Expand Down
13 changes: 6 additions & 7 deletions google/cloud/apiregistry/quickstart/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@
# Use host-OS-specific config lines from bazelrc files.
build --enable_platform_specific_config=true

# The project requires C++ >= 14. By default Bazel adds `-std=c++0x` which
# disables C++14 features, even if the compilers defaults to C++ >= 14
build:linux --cxxopt=-std=c++14
build:macos --cxxopt=-std=c++14
# Protobuf and gRPC require (or soon will require) C++14 to compile the "host"
# The project requires C++ >= 17.
build:linux --cxxopt=-std=c++17
build:macos --cxxopt=-std=c++17
# Protobuf and gRPC require (or soon will require) C++17 to compile the "host"
# targets, such as protoc and the grpc plugin.
build:linux --host_cxxopt=-std=c++14
build:macos --host_cxxopt=-std=c++14
build:linux --host_cxxopt=-std=c++17
build:macos --host_cxxopt=-std=c++17

# Do not create the convenience links. They are inconvenient when the build
# runs inside a docker image or if one builds a quickstart and then builds
Expand Down
3 changes: 3 additions & 0 deletions google/cloud/apiregistry/quickstart/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
cmake_minimum_required(VERSION 3.22...3.31)
project(google-cloud-cpp-apiregistry-quickstart CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(google_cloud_cpp_apiregistry REQUIRED)

# MSVC requires some additional code to select the correct runtime library
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/apiregistry/quickstart/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# The CXX, CXXFLAGS and CXXLD variables are hard-coded. These values work for
# our tests, but applications would typically make them configurable parameters.
CXX=g++
CXXFLAGS=
CXXFLAGS=-std=c++17
CXXLD=$(CXX)
BIN=.

Expand Down
Loading
Loading