Skip to content

Commit c00a3b9

Browse files
authored
Merge pull request open-source-parsers#800 from cdunn2001/patch-1
Fixes open-source-parsers#798 Closes open-source-parsers#799
2 parents ee34ac1 + c59db80 commit c00a3b9

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ Then,
4545
LIB_TYPE=shared
4646
#LIB_TYPE=static
4747
meson --buildtype ${BUILD_TYPE} --default-library ${LIB_TYPE} . build-${LIB_TYPE}
48-
ninja -v -C build-${LIB_TYPE} test
48+
#ninja -v -C build-${LIB_TYPE} test # This stopped working on my Mac.
49+
ninja -v -C build-${LIB_TYPE}
4950
cd build-${LIB_TYPE}
51+
meson test --no-rebuild --print-errorlogs
5052
sudo ninja install
5153

5254
### Building and testing with other build systems

meson.build

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ install_headers(
4646
jsoncpp_headers,
4747
subdir : 'json')
4848

49+
if get_option('default_library') == 'shared' and meson.get_compiler('cpp').get_id() == 'msvc'
50+
dll_export_flag = '-DJSON_DLL_BUILD'
51+
dll_import_flag = '-DJSON_DLL'
52+
else
53+
dll_export_flag = []
54+
dll_import_flag = []
55+
endif
56+
4957
jsoncpp_lib = library(
5058
'jsoncpp',
5159
[ jsoncpp_gen_sources,
@@ -56,7 +64,8 @@ jsoncpp_lib = library(
5664
'src/lib_json/json_writer.cpp'],
5765
soversion : 20,
5866
install : true,
59-
include_directories : jsoncpp_include_directories)
67+
include_directories : jsoncpp_include_directories,
68+
cpp_args: dll_export_flag)
6069

6170
import('pkgconfig').generate(
6271
libraries : jsoncpp_lib,
@@ -82,7 +91,8 @@ jsoncpp_test = executable(
8291
'src/test_lib_json/main.cpp'],
8392
include_directories : jsoncpp_include_directories,
8493
link_with : jsoncpp_lib,
85-
install : false)
94+
install : false,
95+
cpp_args: dll_import_flag)
8696
test(
8797
'unittest_jsoncpp_test',
8898
jsoncpp_test)
@@ -92,7 +102,8 @@ jsontestrunner = executable(
92102
'src/jsontestrunner/main.cpp',
93103
include_directories : jsoncpp_include_directories,
94104
link_with : jsoncpp_lib,
95-
install : false)
105+
install : false,
106+
cpp_args: dll_import_flag)
96107
test(
97108
'unittest_jsontestrunner',
98109
python,

travis.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ set -vex
1717

1818
env | sort
1919

20+
meson --version
21+
ninja --version
2022
meson --buildtype ${BUILD_TYPE} --default-library ${LIB_TYPE} . build-${LIB_TYPE}
2123
ninja -v -C build-${LIB_TYPE}
22-
ninja -v -C build-${LIB_TYPE} test
24+
#ninja -v -C build-${LIB_TYPE} test
25+
cd build-${LIB_TYPE}
26+
meson test --no-rebuild --print-errorlogs
27+
cd -
2328
rm -r build-${LIB_TYPE}

0 commit comments

Comments
 (0)