File tree 3 files changed +23
-5
lines changed 3 files changed +23
-5
lines changed Original file line number Diff line number Diff line change 45
45
LIB_TYPE=shared
46
46
#LIB_TYPE=static
47
47
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}
49
50
cd build-${LIB_TYPE}
51
+ meson test --no-rebuild --print-errorlogs
50
52
sudo ninja install
51
53
52
54
### Building and testing with other build systems
Original file line number Diff line number Diff line change @@ -46,6 +46,14 @@ install_headers(
46
46
jsoncpp_headers,
47
47
subdir : ' json' )
48
48
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
+
49
57
jsoncpp_lib = library (
50
58
' jsoncpp' ,
51
59
[ jsoncpp_gen_sources,
@@ -56,7 +64,8 @@ jsoncpp_lib = library(
56
64
' src/lib_json/json_writer.cpp' ],
57
65
soversion : 20 ,
58
66
install : true ,
59
- include_directories : jsoncpp_include_directories)
67
+ include_directories : jsoncpp_include_directories,
68
+ cpp_args : dll_export_flag)
60
69
61
70
import (' pkgconfig' ).generate(
62
71
libraries : jsoncpp_lib,
@@ -82,7 +91,8 @@ jsoncpp_test = executable(
82
91
' src/test_lib_json/main.cpp' ],
83
92
include_directories : jsoncpp_include_directories,
84
93
link_with : jsoncpp_lib,
85
- install : false )
94
+ install : false ,
95
+ cpp_args : dll_import_flag)
86
96
test (
87
97
' unittest_jsoncpp_test' ,
88
98
jsoncpp_test)
@@ -92,7 +102,8 @@ jsontestrunner = executable(
92
102
' src/jsontestrunner/main.cpp' ,
93
103
include_directories : jsoncpp_include_directories,
94
104
link_with : jsoncpp_lib,
95
- install : false )
105
+ install : false ,
106
+ cpp_args : dll_import_flag)
96
107
test (
97
108
' unittest_jsontestrunner' ,
98
109
python,
Original file line number Diff line number Diff line change @@ -17,7 +17,12 @@ set -vex
17
17
18
18
env | sort
19
19
20
+ meson --version
21
+ ninja --version
20
22
meson --buildtype ${BUILD_TYPE} --default-library ${LIB_TYPE} . build-${LIB_TYPE}
21
23
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 -
23
28
rm -r build-${LIB_TYPE}
You can’t perform that action at this time.
0 commit comments