Skip to content

Commit 85ad599

Browse files
Basic update to CMakeLists.txt to address #1116 (#1117)
Add definitions to static yaml-cpp target (fixes #1116) Also updates CONTRIBUTING instructions for tests
1 parent c86a9e4 commit 85ad599

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ if (YAML_BUILD_SHARED_LIBS)
4646
else()
4747
set(yaml-cpp-type STATIC)
4848
set(yaml-cpp-label-postfix "static")
49-
add_definitions(-DYAML_CPP_STATIC_DEFINE)
5049
endif()
5150

5251
set(build-shared $<BOOL:${YAML_BUILD_SHARED_LIBS}>)
@@ -127,6 +126,8 @@ target_compile_options(yaml-cpp
127126
$<$<CXX_COMPILER_ID:MSVC>:/W3 /wd4127 /wd4355>)
128127

129128
target_compile_definitions(yaml-cpp
129+
PUBLIC
130+
$<$<NOT:$<BOOL:${YAML_BUILD_SHARED_LIBS}>>:YAML_CPP_STATIC_DEFINE>
130131
PRIVATE
131132
$<${build-windows-dll}:${PROJECT_NAME}_DLL>
132133
$<$<NOT:$<BOOL:${YAML_CPP_BUILD_CONTRIB}>>:YAML_CPP_NO_CONTRIB>)

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Commit messages should be in the imperative mood, as described in the [Git contr
1717

1818
# Tests
1919

20-
Please verify the tests pass by running the target `tests/run_tests`.
20+
Please verify the tests pass by running the target `test/yaml-cpp-tests`.
2121

2222
If you are adding functionality, add tests accordingly.
2323

0 commit comments

Comments
 (0)