2 if(NOT DEFINED US_RESOURCE_LINKING_AVAILABLE)
4 # Check linking capability
5 set(_linking_available 0)
10 set(_linking_available 1)
13 elseif(WIN32 AND CMAKE_RC_COMPILER)
14 set(_linking_available 1)
18 COMMAND ${CMAKE_LINKER} -r -b binary -o
"${CMAKE_CURRENT_BINARY_DIR}/us_resource_link.o" "${CMAKE_COMMAND}"
19 RESULT_VARIABLE _result
22 set(_linking_available 1)
27 set(US_RESOURCE_SOURCE_SUFFIX_LINK ${_suffix} CACHE INTERNAL
"CppMicroServices resource source suffix (link)" FORCE)
28 set(US_RESOURCE_SOURCE_SUFFIX_APPEND
".cpp" CACHE INTERNAL
"CppMicroServices resource source suffix (append)" FORCE)
31 set(_default_mode "APPEND")
32 if(_linking_available)
35 set(_default_mode "
LINK")
39 message("Checking for CppMicroServices resource linking capability...${_success}
")
41 set(US_RESOURCE_LINKING_AVAILABLE ${_linking_available} CACHE INTERNAL "CppMicroServices resource linking
" FORCE)
42 set(US_DEFAULT_RESOURCE_MODE ${_default_mode} CACHE INTERNAL "CppMicroServices
default resource mode
" FORCE)
43 if(_default_mode STREQUAL "LINK")
44 set(US_RESOURCE_SOURCE_SUFFIX ${US_RESOURCE_SOURCE_SUFFIX_LINK} CACHE INTERNAL "CppMicroServices resource source suffix
" FORCE)
46 set(US_RESOURCE_SOURCE_SUFFIX ${US_RESOURCE_SOURCE_SUFFIX_APPEND} CACHE INTERNAL "CppMicroServices resource source suffix
" FORCE)
usFunctionCheckCompilerFlags(FLAG_TO_TEST, RESULT_VAR)
usFunctionCheckResourceLinking()