Skip to content

Commit

Permalink
release merge
Browse files Browse the repository at this point in the history
  • Loading branch information
cinemast committed Jun 27, 2015
2 parents 28bca1e + 47a85e5 commit 3b6831e
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 5 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ For Arch Linux there is a [PKGBUILD provided in the AUR](https://aur.archlinux.o
sudo aura -A libjson-rpc-cpp
```

**Gentoo Linux**

```sh
sudo emerge dev-cpp/libjson-rpc-cpp
```

**Mac OS X**

For OS X a [Brew](http://brew.sh) package is available:
Expand Down
54 changes: 54 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# THIS DOCKERFILE DOWNLOADS AND COMPILES CURL, LIBMICROHTTPD, JSONCPP, ARGTABLE AND LIBJSON-RPC-CPP FOR LINUX/DEBIAN

# 2015, author: Péricles Lopes Machado (gogo40) <[email protected]>
# Based on Victor Laskin Dockerfile (http://vitiy.info/dockerfile-example-to-compile-libcurl-for-android-inside-docker-container/)

FROM debian:sid

MAINTAINER Péricles Lopes Machado <[email protected]>

# Create output directories

# Directory to export generated files
RUN mkdir /output

# Directory with generated files
RUN mkdir /build && mkdir /build/include

# Install compilation tools

RUN apt-get update

RUN apt-get install -y \
wget \
build-essential \
cmake \
libjsoncpp-dev \
libargtable2-dev \
libcurl4-openssl-dev \
libmicrohttpd-dev \
git

# Clone and build libjson-rpc-cpp

RUN git clone https://github.com/cinemast/libjson-rpc-cpp.git

RUN cd /libjson-rpc-cpp && \
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=ON \
/libjson-rpc-cpp

RUN cd /libjson-rpc-cpp && \
make -j $(nproc) && \
make install

# Copy to output generated files

RUN cp -r /libjson-rpc-cpp/lib /build
RUN cp -r /usr/local/include/jsonrpccpp /build/include/jsonrpccpp

# To get the results run container with output folder
# Example: docker run -v HOSTFOLDER:/output --rm=true IMAGENAME

ENTRYPOINT cp -r /build/* /output


5 changes: 5 additions & 0 deletions docker/build_linux_debian_libs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

docker build -t debian/libjson-rpc-cpp .
docker run -v $PWD/output:/output --rm=true debian/libjson-rpc-cpp

8 changes: 4 additions & 4 deletions src/jsonrpccpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ if (BUILD_SHARED_LIBS)
endif()

# setup static common library
if (BUILD_STATIC_LIBS)
if (BUILD_STATIC_LIBS OR MSVC)
add_library(jsonrpccommonStatic STATIC ${jsonrpc_source_common} ${jsonrpc_header} ${jsonrpc_helper_source_common})
target_link_libraries(jsonrpccommonStatic ${JSONCPP_LIBRARIES})
set_target_properties(jsonrpccommonStatic PROPERTIES OUTPUT_NAME jsonrpccpp-common)
Expand All @@ -98,7 +98,7 @@ if (BUILD_SHARED_LIBS)
endif()

# setup static client library
if (BUILD_STATIC_LIBS)
if (BUILD_STATIC_LIBS OR MSVC)
add_library(jsonrpcclientStatic STATIC ${jsonrpc_source_client} ${jsonrpc_header} ${jsonrpc_header_client} ${client_connector_source})
target_link_libraries(jsonrpcclientStatic jsonrpccommonStatic ${client_connector_libs})
set_target_properties(jsonrpcclientStatic PROPERTIES OUTPUT_NAME jsonrpccpp-client)
Expand All @@ -117,7 +117,7 @@ if (BUILD_SHARED_LIBS)
endif()

# setup static server library
if (BUILD_STATIC_LIBS)
if (BUILD_STATIC_LIBS OR MSVC)
add_library(jsonrpcserverStatic STATIC ${jsonrpc_source_server} ${jsonrpc_header} ${jsonrpc_header_server} ${server_connector_source})
target_link_libraries(jsonrpcserverStatic jsonrpccommonStatic ${server_connector_libs})
set_target_properties(jsonrpcserverStatic PROPERTIES OUTPUT_NAME jsonrpccpp-server)
Expand All @@ -133,7 +133,7 @@ if (BUILD_SHARED_LIBS OR NOT BUILD_STATIC_LIBS)
list(APPEND ALL_LIBS jsonrpccommon jsonrpcclient jsonrpcserver)
endif()

if (BUILD_STATIC_LIBS)
if (BUILD_STATIC_LIBS OR MSVC)
list(APPEND ALL_LIBS jsonrpccommonStatic jsonrpcclientStatic jsonrpcserverStatic)
endif()

Expand Down
4 changes: 3 additions & 1 deletion src/stubgenerator/client/jsclientstubgenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ using namespace std;
request.id = id++;\n\
request.jsonrpc = \"2.0\";\n\
request.method = method;\n\
request.params = params\n\
if (params !== null) {\n\
request.params = params;\n\
}\n\
JSON.stringify(request);\n\
\n\
$.ajax({\n\
Expand Down

0 comments on commit 3b6831e

Please sign in to comment.