Skip to content

Commit a2e0040

Browse files
committed
Add explicit warning when MSVC-only options are unexpectedly provided
1 parent 76e0b81 commit a2e0040

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,16 @@ option(BUILD_SHARED_LIBS_WITH_STATIC_MONGOC
157157
OFF
158158
)
159159

160+
if(DEFINED CACHE{ENABLE_ABI_TAG_IN_LIBRARY_FILENAMES} AND NOT MSVC)
161+
message(WARNING "ENABLE_ABI_TAG_IN_LIBRARY_FILENAMES is an MSVC-only option and will be ignored by the current configuration")
162+
unset(ENABLE_ABI_TAG_IN_LIBRARY_FILENAMES CACHE)
163+
endif()
164+
165+
if(DEFINED CACHE{ENABLE_ABI_TAG_IN_PKGCONFIG_FILENAMES} AND NOT $CACHE{ENABLE_ABI_TAG_IN_LIBRARY_FILENAMES})
166+
message(WARNING "ENABLE_ABI_TAG_IN_PKGCONFIG_FILENAMES requires ENABLE_ABI_TAG_IN_LIBRARY_FILENAMES=ON and will be ignored by the current configuration")
167+
unset(ENABLE_ABI_TAG_IN_PKGCONFIG_FILENAMES CACHE)
168+
endif()
169+
160170
# Allow user to disable embedding of ABI tag in library filenames (MSVC only).
161171
cmake_dependent_option(ENABLE_ABI_TAG_IN_LIBRARY_FILENAMES "Embed ABI tag in library filenames" ON "MSVC" OFF)
162172

0 commit comments

Comments
 (0)