update config

This commit is contained in:
Laurent Perron
2024-02-01 22:13:04 +01:00
parent 9038ffdcd0
commit 896956a699
7 changed files with 91 additions and 9 deletions

View File

@@ -89,6 +89,8 @@ git_repository(
git_repository(
name = "com_google_absl",
tag = "20240116.0",
patches = ["//patches:abseil-cpp-20240116.0.patch"],
patch_args = ["-p1"],
remote = "https://github.com/abseil/abseil-cpp.git",
)

View File

@@ -15,13 +15,13 @@ index 2471778a8f..17fd1e8c34 100644
if ( ival == 0 )
{
- (void) google::SetVLOGLevel("*", google::GLOG_INFO);
+ absl::SetFlag(&FLAGS_stderrthreshold, 2);
+ absl::SetFlag(&FLAGS_stderrthreshold, 2);
lpi->lp_info = false;
}
else
{
- (void) google::SetVLOGLevel("*", google::GLOG_ERROR);
+ absl::SetFlag(&FLAGS_stderrthreshold, 0);
+ absl::SetFlag(&FLAGS_stderrthreshold, 0);
lpi->lp_info = true;
}
break;

View File

@@ -83,6 +83,7 @@ if(BUILD_absl)
abseil-cpp
GIT_REPOSITORY "https://github.com/abseil/abseil-cpp.git"
GIT_TAG "20240116.0"
PATCH_COMMAND git apply --ignore-whitespace "${CMAKE_CURRENT_LIST_DIR}/../../patches/abseil-cpp-20240116.0.patch"
)
FetchContent_MakeAvailable(abseil-cpp)
list(POP_BACK CMAKE_MESSAGE_INDENT)

View File

@@ -106,8 +106,7 @@ FetchContent_Declare(
absl
GIT_REPOSITORY "https://github.com/abseil/abseil-cpp.git"
GIT_TAG "20240116.0"
#PATCH_COMMAND git apply "${CMAKE_CURRENT_LIST_DIR}/@PATCHES_PATH@/abseil-cpp-20240116.0.patch"
)
PATCH_COMMAND git apply "${CMAKE_CURRENT_LIST_DIR}/@PATCHES_PATH@/abseil-cpp-20240116.0.patch")
FetchContent_MakeAvailable(absl)
list(POP_BACK CMAKE_MESSAGE_INDENT)
message(CHECK_PASS "fetched")

View File

@@ -12,9 +12,9 @@
# limitations under the License.
exports_files([
"abseil-cpp-20240116.0.patch",
"protobuf-v25.2.patch",
"pybind11_abseil.patch",
"pybind11_bazel.patch",
"pybind11.patch",
"pybind11_protobuf.patch",
"pybind11.patch",
])

View File

@@ -0,0 +1,80 @@
diff --git a/CMake/AbseilDll.cmake b/CMake/AbseilDll.cmake
index 47f3beeb..43217c85 100644
--- a/CMake/AbseilDll.cmake
+++ b/CMake/AbseilDll.cmake
@@ -624,31 +624,44 @@ set(ABSL_INTERNAL_TEST_DLL_TARGETS
include(CheckCXXSourceCompiles)
-check_cxx_source_compiles(
- [==[
-#ifdef _MSC_VER
-# if _MSVC_LANG < 201703L
-# error "The compiler defaults or is configured for C++ < 17"
-# endif
-#elif __cplusplus < 201703L
-# error "The compiler defaults or is configured for C++ < 17"
-#endif
-int main() { return 0; }
-]==]
+message(WARNING "ABSL_CXX_STANDARD: ${ABSL_CXX_STANDARD}")
+message(WARNING "CMAKE_CXX_STANDARD: ${CMAKE_CXX_STANDARD}")
+message(WARNING "CMAKE_CXX_STANDARD_REQUIRED: ${CMAKE_CXX_STANDARD_REQUIRED}")
+message(WARNING "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
+
+if(CMAKE_CXX_STANDARD GREATER_EQUAL 17)
+ set(ABSL_INTERNAL_AT_LEAST_CXX17 TRUE)
+else()
+ check_cxx_source_compiles(
+ [==[
+ #ifdef _MSC_VER
+ # if _MSVC_LANG < 201703L
+ # error "The compiler defaults or is configured for C++ < 17"
+ # endif
+ #elif __cplusplus < 201703L
+ # error "The compiler defaults or is configured for C++ < 17"
+ #endif
+ int main() { return 0; }
+ ]==]
ABSL_INTERNAL_AT_LEAST_CXX17)
+endif()
-check_cxx_source_compiles(
- [==[
-#ifdef _MSC_VER
-# if _MSVC_LANG < 202002L
-# error "The compiler defaults or is configured for C++ < 20"
-# endif
-#elif __cplusplus < 202002L
-# error "The compiler defaults or is configured for C++ < 20"
-#endif
-int main() { return 0; }
-]==]
+if(CMAKE_CXX_STANDARD GREATER_EQUAL 20)
+ set(ABSL_INTERNAL_AT_LEAST_CXX20 TRUE)
+else()
+ check_cxx_source_compiles(
+ [==[
+ #ifdef _MSC_VER
+ # if _MSVC_LANG < 202002L
+ # error "The compiler defaults or is configured for C++ < 20"
+ # endif
+ #elif __cplusplus < 202002L
+ # error "The compiler defaults or is configured for C++ < 20"
+ #endif
+ int main() { return 0; }
+ ]==]
ABSL_INTERNAL_AT_LEAST_CXX20)
+endif()
if(ABSL_INTERNAL_AT_LEAST_CXX20)
set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_20)
@@ -656,6 +669,7 @@ elseif(ABSL_INTERNAL_AT_LEAST_CXX17)
set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_17)
else()
set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_14)
+ message(FATAL_ERROR "Should not pass here !!!")
endif()
function(absl_internal_dll_contains)

View File

@@ -15,13 +15,13 @@ index 2471778a8f..17fd1e8c34 100644
if ( ival == 0 )
{
- (void) google::SetVLOGLevel("*", google::GLOG_INFO);
+ absl::SetFlag(&FLAGS_stderrthreshold, 2);
+ absl::SetFlag(&FLAGS_stderrthreshold, 2);
lpi->lp_info = false;
}
else
{
- (void) google::SetVLOGLevel("*", google::GLOG_ERROR);
+ absl::SetFlag(&FLAGS_stderrthreshold, 0);
+ absl::SetFlag(&FLAGS_stderrthreshold, 0);
lpi->lp_info = true;
}
break;
@@ -42,4 +42,4 @@ index 2471778a8f..17fd1e8c34 100644
+ if ( ! WriteProtoToFile(filespec, proto, operations_research::ProtoWriteFormat::kProtoText, true).ok() )
{
SCIPerrorMessage("Could not write <%s>\n", fname);
return SCIP_READERROR;
return SCIP_READERROR;