diff --git a/cmake/libprotobuf-lite.cmake b/cmake/libprotobuf-lite.cmake index f36a7acf6c..a0bc9945fd 100644 --- a/cmake/libprotobuf-lite.cmake +++ b/cmake/libprotobuf-lite.cmake @@ -103,7 +103,7 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Android") target_link_libraries(libprotobuf-lite log) endif() target_include_directories(libprotobuf-lite PUBLIC ${protobuf_source_dir}/src) -if(MSVC AND protobuf_BUILD_SHARED_LIBS) +if(protobuf_BUILD_SHARED_LIBS) target_compile_definitions(libprotobuf-lite PUBLIC PROTOBUF_USE_DLLS PRIVATE LIBPROTOBUF_EXPORTS) diff --git a/cmake/libprotobuf.cmake b/cmake/libprotobuf.cmake index 42f25668e1..51003b80a9 100644 --- a/cmake/libprotobuf.cmake +++ b/cmake/libprotobuf.cmake @@ -118,7 +118,7 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Android") target_link_libraries(libprotobuf log) endif() target_include_directories(libprotobuf PUBLIC ${protobuf_source_dir}/src) -if(MSVC AND protobuf_BUILD_SHARED_LIBS) +if(protobuf_BUILD_SHARED_LIBS) target_compile_definitions(libprotobuf PUBLIC PROTOBUF_USE_DLLS PRIVATE LIBPROTOBUF_EXPORTS)