Skip to content
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

Add RapidJSON recipe #2192

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions recipes/rapidjson/bld.bat
@@ -0,0 +1,4 @@
set RAPIDJSON_DIR=%SRC_DIR%

REM Copy headers
xcopy /S %RAPIDJSON_DIR%\include %LIBRARY_INC%
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to use the make install approach on windows too? The benefit is that it will place the rapidjsonConfig.cmake and rapidjsonConfigVersion.cmake files in the right configuration folder for cmake under the prefix, allowing cmake to find it when building packages that depend upon rapidjson.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(We can confirm that the make install works on windows for rapidJSON.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit outside my expertise -- can you propose a new recipe (feel free to start from this one if you'd like) with the Windows fixes? I am happy to be on the maintainer list

20 changes: 20 additions & 0 deletions recipes/rapidjson/build.sh
@@ -0,0 +1,20 @@
#!/bin/env bash

set -e

mkdir build-dir
cd build-dir

cmake -DRAPIDJSON_HAS_STDSTRING=ON \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DRAPIDJSON_BUILD_CXX11=ON \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already the default value for RAPIDJSON_BUILD_CXX11.

-DRAPIDJSON_BUILD_TESTS=OFF \
-DRAPIDJSON_BUILD_EXAMPLES=OFF \
-DRAPIDJSON_BUILD_DOC=OFF \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_BUILD_TYPE=release \
..

make -j${CPU_COUNT}
ctest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure you can run ctest if you don't build the examples (with -DRAPIDJSON_BUILD_TESTS=ON).

make install
34 changes: 34 additions & 0 deletions recipes/rapidjson/meta.yaml
@@ -0,0 +1,34 @@
{% set version = "1.1.0" %}

package:
name: rapidjson
version: {{ version }}

source:
url: https://github.com/miloyip/rapidjson/archive/v{{ version }}.tar.gz
fn: {{ version }}.tar.gz
md5: badd12c511e081fec6c89c43a7027bce

build:
number: 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the build number start at 0?


requirements:
build:
- toolchain
- cmake

test:
commands:
- test -e $PREFIX/include/rapidjson/rapidjson.h # [unix]
- if exist %LIBRARY_INC%\rapidjson\rapidjson.h (exit 0) else (exit 1) # [win]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add a test for the presence of the RapidJSONConfig.cmake and RapidJSONConfigVersion.cmake?

The RapidJSONcmake install places these files in directory which is PREFIX/lib/cmake/RapidJSON which is quite unusual but resolved correctly by cmake.


about:
home: https://github.com/miloyip/rapidjson
summary: A fast JSON parser/generator for C++ with both SAX/DOM style API
license: MIT
license_file: license.txt
license_family: MIT

extra:
recipe-maintainers:
- wesm
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you be OK adding me and @JohanMabille as maintainers of the recipe? We were just about to propose a recipe for this.