File tree Expand file tree Collapse file tree 3 files changed +23
-5
lines changed Expand file tree Collapse file tree 3 files changed +23
-5
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff 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+
4957jsoncpp_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
6170import (' 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)
8696test (
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)
96107test (
97108 ' unittest_jsontestrunner' ,
98109 python,
Original file line number Diff line number Diff line change @@ -17,7 +17,12 @@ set -vex
1717
1818env | sort
1919
20+ meson --version
21+ ninja --version
2022meson --buildtype ${BUILD_TYPE} --default-library ${LIB_TYPE} . build-${LIB_TYPE}
2123ninja -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 -
2328rm -r build-${LIB_TYPE}
You can’t perform that action at this time.
0 commit comments