File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -377,13 +377,7 @@ function(generate_proto_library)
377377 else ()
378378 set_target_properties (${PROTO_NAME} _proto PROPERTIES CXX_STANDARD 17)
379379 endif ()
380- if (MSVC AND BUILD_SHARED_LIBS )
381- target_compile_definitions (${PROTO_NAME} _proto INTERFACE "OR_PROTO_DLL=__declspec(dllimport)" )
382- target_compile_definitions (${PROTO_NAME} _proto PRIVATE "OR_PROTO_DLL=__declspec(dllexport)" )
383- else ()
384- target_compile_definitions (${PROTO_NAME} _proto PUBLIC "OR_PROTO_DLL=" )
385- endif ()
386- set_target_properties (${PROTO_NAME} _proto PROPERTIES
380+ set_target_properties (${PROTO_NAME} _proto PROPERTIES
387381 CXX_STANDARD_REQUIRED ON
388382 CXX_EXTENSIONS OFF
389383 POSITION_INDEPENDENT_CODE ON )
@@ -393,6 +387,12 @@ endif()
393387 #$<TARGET_PROPERTY:protobuf::libprotobuf,INTERFACE_INCLUDE_DIRECTORIES>
394388 )
395389 target_compile_definitions (${PROTO_NAME} _proto PUBLIC ${OR_TOOLS_COMPILE_DEFINITIONS} )
390+ if (MSVC AND BUILD_SHARED_LIBS )
391+ target_compile_definitions (${PROTO_NAME} _proto INTERFACE "OR_PROTO_DLL=__declspec(dllimport)" )
392+ target_compile_definitions (${PROTO_NAME} _proto PRIVATE "OR_PROTO_DLL=__declspec(dllexport)" )
393+ else ()
394+ target_compile_definitions (${PROTO_NAME} _proto PUBLIC "OR_PROTO_DLL=" )
395+ endif ()
396396 target_compile_options (${PROTO_NAME} _proto PUBLIC ${OR_TOOLS_COMPILE_OPTIONS} )
397397 target_link_libraries (${PROTO_NAME} _proto PUBLIC protobuf::libprotobuf ${PROTO_LINK_LIBRARIES} )
398398 add_library (${PROJECT_NAMESPACE} ::${PROTO_NAME} _proto ALIAS ${PROTO_NAME} _proto)
You can’t perform that action at this time.
0 commit comments