forked from protocolbuffers/protobuf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
23 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 909cfe39a..5f0b375ab 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -215,7 +215,7 @@ if (NOT MSVC) | ||
return static_cast<int>(std::atomic<int64_t>{}); | ||
} | ||
" protobuf_HAVE_BUILTIN_ATOMICS) | ||
- if (NOT protobuf_HAVE_BUILTIN_ATOMICS) | ||
+ if (NOT protobuf_HAVE_BUILTIN_ATOMICS OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "riscv") | ||
set(protobuf_LINK_LIBATOMIC true) | ||
endif (NOT protobuf_HAVE_BUILTIN_ATOMICS) | ||
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) | ||
@@ -405,3 +405,8 @@ endif (protobuf_BUILD_EXAMPLES) | ||
if(protobuf_VERBOSE) | ||
message(STATUS "Protocol Buffers Configuring done") | ||
endif(protobuf_VERBOSE) | ||
+ | ||
+if(CMAKE_SYSTEM_PROCESSOR STREQUAL "riscv64") | ||
+ string(APPEND CMAKE_C_STANDARD_LIBRARIES " -latomic") | ||
+ string(APPEND CMAKE_CXX_STANDARD_LIBRARIES " -latomic") | ||
+endif() | ||
|