Skip to content

Commit

Permalink
[TUBEMQ-369]hope to add an option in the compilation script (like `ma…
Browse files Browse the repository at this point in the history
…ke lib` etc...), to quick generation of dynamic / static libraries and header files (#285)

Co-authored-by: gosonzhang <gosonzhang@tencent.com>
  • Loading branch information
gosonzhang and gosonzhang committed Oct 14, 2020
1 parent 47e15cf commit c208153
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 3 deletions.
3 changes: 3 additions & 0 deletions tubemq-client-twins/tubemq-client-cpp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,8 @@
## Step to build
* install protobuf
* ./build_linux.sh
* cd release/
* chmod +x release_linux.sh
* ./release_linux.sh


27 changes: 27 additions & 0 deletions tubemq-client-twins/tubemq-client-cpp/conf/client.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
;
; Tencent is pleased to support the open source community by making TubeMQ available.
;
; Copyright (C) 2012-2019 Tencent. All Rights Reserved.
;
; Licensed under the Apache License, Version 2.0 (the "License"); you may not use
; this file except in compliance with the License. You may obtain a copy of the
; License at
;
; https://opensource.org/licenses/Apache-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
; WARRANTIES OF ANY KIND, either express or implied. See the License for the
; specific language governing permissions and limitations under the License.
;

[TubeMQ]
//unit M
log_size=100
// 0:trace, 1:debug, 2:info, 3:warn, 4:error
log_level=2
// max log file count
log_num=10
// need include log filename
log_path=../log/tubemq

60 changes: 60 additions & 0 deletions tubemq-client-twins/tubemq-client-cpp/release/release_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#


#!/bin/bash

rm tubemq -rf
rm lib -rf
rm *.tar.gz

mkdir tubemq
mkdir tubemq/lib
mkdir tubemq/include
mkdir tubemq/conf
mkdir tubemq/demo
mkdir lib

cp ../build/src/libtubemq.a lib/
cp ../build/third_party/lib/liblog4cplus.a lib/
cp ../build/third_party/lib64/libsnappy.a lib/
cp ../build/proto/libtubemq_proto.a lib/
cp /usr/local/lib/libprotobuf.a lib/
cp -rf ../include/* tubemq/include/
cp ../conf/* tubemq/conf/
cp ../example/consumer/test_consumer.cc tubemq/demo/
cd lib
for file in *.a
do
echo "ar x "$file
ar x $file
done
ar cru libtubemq_rel.a *.o
ranlib libtubemq_rel.a
rm *.o
mv libtubemq_rel.a ../tubemq/lib/
cd ..

cd tubemq/demo
g++ -g -std=c++11 -c test_consumer.cc -I../include/
#g++ -g -std=c++11 -o test_consumer test_consumer.o -L../lib/ -ltubemq -ltubemq_proto -lssl -lcrypto -lpthread -lprotobuf -llog4cplus -lsnappy -lrt
g++ -g -std=c++11 -o test_consumer test_consumer.o -L../lib/ -ltubemq_rel -lssl -lcrypto -lpthread -lrt
rm *.o
cd -
tar -czvf tubemq.tar.gz tubemq/
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ include(ExternalProject)
ExternalProject_Add(
rapidjson
PREFIX "rapidjson"
GIT_REPOSITORY "https://github.com/Tencent/rapidjson.git"
GIT_TAG f54b0e47a08782a6131cc3d60f94d038fa6e0a51
TIMEOUT 20
URL "https://github.com/Tencent/rapidjson/archive/v1.1.0.tar.gz"
CMAKE_ARGS
-DRAPIDJSON_BUILD_TESTS=OFF
-DRAPIDJSON_BUILD_DOC=OFF
Expand Down

0 comments on commit c208153

Please sign in to comment.