add ADD_LINK_DEFINITIONS support for cmakelist file

This commit is contained in:
Neucrack
2025-08-21 14:49:20 +08:00
parent e2517649e2
commit b913a091dd
2 changed files with 15 additions and 3 deletions

View File

@@ -137,11 +137,23 @@ function(register_component)
endif()
endforeach()
# Add definitions public
foreach(difinition ${ADD_LINK_DEFINITIONS})
if(${include_type} STREQUAL INTERFACE)
target_link_options(${component_name} INTERFACE ${difinition})
else()
target_link_options(${component_name} PUBLIC ${difinition})
endif()
endforeach()
# Add definitions private
foreach(difinition ${ADD_DEFINITIONS_PRIVATE})
target_compile_options(${component_name} PRIVATE ${difinition})
target_link_options(${component_name} PRIVATE ${difinition})
endforeach()
foreach(difinition ${ADD_LINK_DEFINITIONS_PRIVATE})
target_link_options(${component_name} PRIVATE ${difinition})
endforeach()
# Add lib search path
if(ADD_LINK_SEARCH_PATH)