Changeset View
Changeset View
Standalone View
Standalone View
build_files/cmake/macros.cmake
| Show First 20 Lines • Show All 410 Lines • ▼ Show 20 Lines | function(setup_liblinks | ||||
| set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}" PARENT_SCOPE) | set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}" PARENT_SCOPE) | ||||
| set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}" PARENT_SCOPE) | set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}" PARENT_SCOPE) | ||||
| set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} ${PLATFORM_LINKFLAGS_RELEASE}" PARENT_SCOPE) | set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} ${PLATFORM_LINKFLAGS_RELEASE}" PARENT_SCOPE) | ||||
| set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}" PARENT_SCOPE) | set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}" PARENT_SCOPE) | ||||
| set(CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}" PARENT_SCOPE) | set(CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}" PARENT_SCOPE) | ||||
| set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} ${PLATFORM_LINKFLAGS_RELEASE}" PARENT_SCOPE) | set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} ${PLATFORM_LINKFLAGS_RELEASE}" PARENT_SCOPE) | ||||
| # Work around undefined reference errors when disabling certain libraries. | |||||
| # Finding the right order for all combinations of options is too hard, so | |||||
| # we use --start-group and --end-group so the linker does not discard symbols | |||||
| # too early. This appears to have no significant performance impact. | |||||
| if(UNIX AND NOT APPLE) | |||||
| target_link_libraries( | |||||
| ${target} | |||||
| -Wl,--start-group | |||||
| ) | |||||
| endif() | |||||
| # jemalloc must be early in the list, to be before pthread (see T57998) | # jemalloc must be early in the list, to be before pthread (see T57998) | ||||
| if(WITH_MEM_JEMALLOC) | if(WITH_MEM_JEMALLOC) | ||||
| target_link_libraries(${target} ${JEMALLOC_LIBRARIES}) | target_link_libraries(${target} ${JEMALLOC_LIBRARIES}) | ||||
| endif() | endif() | ||||
| target_link_libraries( | target_link_libraries( | ||||
| ${target} | ${target} | ||||
| ${PNG_LIBRARIES} | ${PNG_LIBRARIES} | ||||
| ▲ Show 20 Lines • Show All 160 Lines • ▼ Show 20 Lines | function(setup_liblinks | ||||
| ) | ) | ||||
| # System libraries with no dependencies such as platform link libs or opengl should go last. | # System libraries with no dependencies such as platform link libs or opengl should go last. | ||||
| target_link_libraries(${target} | target_link_libraries(${target} | ||||
| ${BLENDER_GL_LIBRARIES}) | ${BLENDER_GL_LIBRARIES}) | ||||
| # target_link_libraries(${target} ${PLATFORM_LINKLIBS} ${CMAKE_DL_LIBS}) | # target_link_libraries(${target} ${PLATFORM_LINKLIBS} ${CMAKE_DL_LIBS}) | ||||
| target_link_libraries(${target} ${PLATFORM_LINKLIBS}) | target_link_libraries(${target} ${PLATFORM_LINKLIBS}) | ||||
| # See comments above regarding --start-group. | |||||
| if(UNIX AND NOT APPLE) | |||||
| target_link_libraries( | |||||
| ${target} | |||||
| -Wl,--end-group | |||||
| ) | |||||
| endif() | |||||
| endfunction() | endfunction() | ||||
| macro(TEST_SSE_SUPPORT | macro(TEST_SSE_SUPPORT | ||||
| _sse_flags | _sse_flags | ||||
| _sse2_flags) | _sse2_flags) | ||||
| include(CheckCSourceRuns) | include(CheckCSourceRuns) | ||||
| ▲ Show 20 Lines • Show All 666 Lines • Show Last 20 Lines | |||||