You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2020/12/29 02:51:38 UTC

[GitHub] [rocketmq-client-cpp] ifplusor commented on a change in pull request #338: [ISSUE #194] Fix build error on aarch64/arm platform

ifplusor commented on a change in pull request #338:
URL: https://github.com/apache/rocketmq-client-cpp/pull/338#discussion_r549078967



##########
File path: CMakeLists.txt
##########
@@ -183,11 +183,14 @@ ELSE ()
             # -rdynamic
             )
 
-    if (CMAKE_BUILD_BITS EQUAL 32)
-        list(APPEND CXX_FLAGS "-m32")
-    else () #not-condition
-        list(APPEND CXX_FLAGS "-m64")
-    endif ()
+    option(BUILD_FOR_ARM "Build for arm64 platform" ON)
+    if (NOT ${BUILD_FOR_ARM} MATCHES "ON")

Review comment:
       no “matches” is ok

##########
File path: build.sh
##########
@@ -342,7 +344,11 @@ BuildJsonCPP() {
   echo "build jsoncpp success."
   if [ ! -f ${install_lib_dir}/lib/libjsoncpp.a ]; then
     echo " ./bin/lib directory is not libjsoncpp.a"
-    cp ${install_lib_dir}/lib/x86_64-linux-gnu/libjsoncpp.a ${install_lib_dir}/lib/
+    if [ "$(uname -m)" = "aarch64" ]; then
+      cp ${install_lib_dir}/lib/aarch64-linux-gnu/libjsoncpp.a ${install_lib_dir}/lib/
+    else
+      cp ${install_lib_dir}/lib/x86_64-linux-gnu/libjsoncpp.a ${install_lib_dir}/lib/
+    fi

Review comment:
       It seems "$(uname -m)-linux-gnu" is better.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org