-
Notifications
You must be signed in to change notification settings - Fork 178
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
Allow use of vcpkg for handling local dependencies #3950
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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,23 @@ | ||
diff --git a/absl/time/internal/cctz/src/zone_info_source.cc b/absl/time/internal/cctz/src/zone_info_source.cc | ||
index 7209533..5ab5a59 100644 | ||
--- a/absl/time/internal/cctz/src/zone_info_source.cc | ||
+++ b/absl/time/internal/cctz/src/zone_info_source.cc | ||
@@ -65,7 +65,7 @@ ZoneInfoSourceFactory zone_info_source_factory __attribute__((weak)) = | ||
extern ZoneInfoSourceFactory zone_info_source_factory; | ||
extern ZoneInfoSourceFactory default_factory; | ||
ZoneInfoSourceFactory default_factory = DefaultFactory; | ||
-#if defined(_M_IX86) | ||
+#if defined(_M_IX86) || defined(_M_ARM) | ||
#pragma comment( \ | ||
linker, \ | ||
"/alternatename:?zone_info_source_factory@cctz_extension@time_internal@" ABSL_INTERNAL_MANGLED_NS \ | ||
@@ -83,8 +83,7 @@ ZoneInfoSourceFactory default_factory = DefaultFactory; | ||
"@@U?$default_delete@VZoneInfoSource@cctz@time_internal@" ABSL_INTERNAL_MANGLED_NS \ | ||
"@@@std@@@std@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z@" ABSL_INTERNAL_MANGLED_BACKREFERENCE \ | ||
"@@ZA") | ||
-#elif defined(_M_IA_64) || defined(_M_AMD64) || defined(_M_ARM) || \ | ||
- defined(_M_ARM64) | ||
+#elif defined(_M_IA_64) || defined(_M_AMD64) || defined(_M_ARM64) | ||
#pragma comment( \ | ||
linker, \ | ||
"/alternatename:?zone_info_source_factory@cctz_extension@time_internal@" ABSL_INTERNAL_MANGLED_NS \ |
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,94 @@ | ||
diff --git a/CMake/abslConfig.cmake.in b/CMake/abslConfig.cmake.in | ||
index 62d246d..afcec1f 100644 | ||
--- a/CMake/abslConfig.cmake.in | ||
+++ b/CMake/abslConfig.cmake.in | ||
@@ -6,3 +6,5 @@ find_dependency(Threads) | ||
@PACKAGE_INIT@ | ||
|
||
include ("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") | ||
+ | ||
+set(ABSL_USE_CXX17 @ABSL_USE_CXX17@) | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 750a475..239977f 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -67,6 +67,23 @@ else() | ||
option(ABSL_ENABLE_INSTALL "Enable install rule" ON) | ||
endif() | ||
|
||
+# CXX standard | ||
+option(ABSL_USE_CXX17 "Enable CXX 17 standard" OFF) | ||
+ | ||
+if (ABSL_USE_CXX17) | ||
+ set(CMAKE_CXX_STANDARD 17) | ||
+ set(STD_ANY 1) | ||
+ set(STD_OPTIONAL 1) | ||
+ set(STD_STRING_VIEW 1) | ||
+ set(STD_VARIANT 1) | ||
+else() | ||
+ set(CMAKE_CXX_STANDARD 11) | ||
+ set(STD_ANY 0) | ||
+ set(STD_OPTIONAL 0) | ||
+ set(STD_STRING_VIEW 0) | ||
+ set(STD_VARIANT 0) | ||
+endif() | ||
+ | ||
option(ABSL_PROPAGATE_CXX_STD | ||
"Use CMake C++ standard meta features (e.g. cxx_std_11) that propagate to targets that link to Abseil" | ||
OFF) # TODO: Default to ON for CMake 3.8 and greater. | ||
diff --git a/absl/base/CMakeLists.txt b/absl/base/CMakeLists.txt | ||
index c7233cb..65a9076 100644 | ||
--- a/absl/base/CMakeLists.txt | ||
+++ b/absl/base/CMakeLists.txt | ||
@@ -38,6 +38,11 @@ absl_cc_library( | ||
COPTS | ||
${ABSL_DEFAULT_COPTS} | ||
) | ||
+if (NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/options.h.in) | ||
+ file(RENAME ${CMAKE_CURRENT_LIST_DIR}/options.h ${CMAKE_CURRENT_LIST_DIR}/options.h.in) | ||
+endif() | ||
+file(REMOVE ${CMAKE_CURRENT_LIST_DIR}/options.h) | ||
+configure_file(${CMAKE_CURRENT_LIST_DIR}/options.h.in ${CMAKE_CURRENT_LIST_DIR}/options.h @ONLY) | ||
|
||
absl_cc_library( | ||
NAME | ||
diff --git a/absl/base/options.h b/absl/base/options.h | ||
index 56b4e36..0b098ed 100644 | ||
--- a/absl/base/options.h | ||
+++ b/absl/base/options.h | ||
@@ -100,7 +100,7 @@ | ||
// User code should not inspect this macro. To check in the preprocessor if | ||
// absl::any is a typedef of std::any, use the feature macro ABSL_USES_STD_ANY. | ||
|
||
-#define ABSL_OPTION_USE_STD_ANY 2 | ||
+#define ABSL_OPTION_USE_STD_ANY @STD_ANY@ | ||
|
||
|
||
// ABSL_OPTION_USE_STD_OPTIONAL | ||
@@ -127,7 +127,7 @@ | ||
// absl::optional is a typedef of std::optional, use the feature macro | ||
// ABSL_USES_STD_OPTIONAL. | ||
|
||
-#define ABSL_OPTION_USE_STD_OPTIONAL 2 | ||
+#define ABSL_OPTION_USE_STD_OPTIONAL @STD_OPTIONAL@ | ||
|
||
|
||
// ABSL_OPTION_USE_STD_STRING_VIEW | ||
@@ -154,7 +154,7 @@ | ||
// absl::string_view is a typedef of std::string_view, use the feature macro | ||
// ABSL_USES_STD_STRING_VIEW. | ||
|
||
-#define ABSL_OPTION_USE_STD_STRING_VIEW 2 | ||
+#define ABSL_OPTION_USE_STD_STRING_VIEW @STD_STRING_VIEW@ | ||
|
||
// ABSL_OPTION_USE_STD_VARIANT | ||
// | ||
@@ -180,7 +180,7 @@ | ||
// absl::variant is a typedef of std::variant, use the feature macro | ||
// ABSL_USES_STD_VARIANT. | ||
|
||
-#define ABSL_OPTION_USE_STD_VARIANT 2 | ||
+#define ABSL_OPTION_USE_STD_VARIANT @STD_VARIANT@ | ||
|
||
|
||
// ABSL_OPTION_USE_INLINE_NAMESPACE |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bootstrap.ps1
also needs to be updated.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have any way to test changes here so I didn't bother attempting to write something that might or might not work. I was hoping one of our Windows dev folks would be able to add the option after this PR is merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll preface this with a heavy "I have no idea what I'm talking about" disclaimer, but another thing that caught my eye in the vcpkg docs was that they seemed to focus on IDEs when talking about configuring Windows projects. I still think we should add a bootstrap.ps1 option for symmetry, but I wasn't sure if it'd actually be used or if there'd be some other set of instructions for configuring IDEs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dependnecies
->dependeNcies
next time someone touches this