-
Notifications
You must be signed in to change notification settings - Fork 153
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
Incompatible with GCC >= 11 (default -std=c++17) #1950
Comments
This change to the root CMakeLists.txt seems to fix this: diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3ec89c6b..5fa4b525 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.5.0)
project(prjxray)
option(PRJXRAY_BUILD_TESTING "" OFF)
+set(CMAKE_CXX_STANDARD 14)
+
# Add sanitizers-cmake package
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/third_party/sanitizers-cmake/cmake" ${CMAKE_MODULE_PATH})
find_package(Sanitizers)
@@ -36,8 +38,6 @@ target_include_directories(yaml-cpp PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/third_party/yaml-cpp/include>
)
-# Set the CXX standard and compile time for our code only.
-set(CMAKE_CXX_STANDARD 14)
add_compile_options(-Wall -Werror)
add_subdirectory(lib) |
Thanks @LAK132 I confirm that the changes to CMakeLists.txt that you proposed fixed the following issue I had
|
Fixed with #2118. Closing. |
GCC 11 updated the default
-std=
for C++ tognu++17
. This causes abseil (which specifies no explicit-std=
) to be built as C++17, while the rest of prjxray is build withc++14
: https://github.com/f4pga/prjxray/blob/master/CMakeLists.txt#L40This is explicitly unsupported by abseil: https://github.com/abseil/abseil-cpp/blob/48f72c227b94b06387106f71d4450b31e88e283b/absl/base/options.h#L144-L151
It causes the following linker error:
...because abseil compiles using
std::string_view
, whilebits2rbt
links againstabsl::string_view
.The text was updated successfully, but these errors were encountered: