All: Add static library

This commit is contained in:
Jeffrey Pfau 2015-02-12 02:27:59 -08:00
parent d99731e1e7
commit 1f6732b9bb
1 changed files with 8 additions and 4 deletions

View File

@ -253,7 +253,7 @@ if (USE_LZMA)
endif()
# Binaries
add_library(${BINARY_NAME} SHARED
add_library(${BINARY_NAME}-static STATIC
${ARM_SRC}
${GBA_SRC}
${GBA_SV_SRC}
@ -263,9 +263,13 @@ add_library(${BINARY_NAME} SHARED
${VFS_SRC}
${OS_SRC}
${THIRD_PARTY_SRC})
target_link_libraries(${BINARY_NAME} m ${DEBUGGER_LIB} ${OS_LIB} ${DEPENDENCY_LIB})
install(TARGETS ${BINARY_NAME} DESTINATION lib COMPONENT lib${BINARY_NAME})
set_target_properties(${BINARY_NAME} PROPERTIES VERSION ${LIB_VERSION_STRING} SOVERSION ${LIB_VERSION_ABI})
set_target_properties(${BINARY_NAME}-static PROPERTIES OUTPUT_NAME ${BINARY_NAME})
get_property(STATIC_BINARY TARGET ${BINARY_NAME}-static PROPERTY LOCATION)
add_library(${BINARY_NAME} SHARED)
target_link_libraries(${BINARY_NAME} ${BINARY_NAME}-static m ${DEBUGGER_LIB} ${OS_LIB} ${DEPENDENCY_LIB})
install(TARGETS ${BINARY_NAME} ${BINARY_NAME}-static DESTINATION lib COMPONENT lib${BINARY_NAME})
set_target_properties(${BINARY_NAME} PROPERTIES VERSION ${LIB_VERSION_STRING} SOVERSION ${LIB_VERSION_ABI} LINKER_LANGUAGE C LINK_FLAGS "-Wl,-force_load,${STATIC_BINARY}")
if(BUILD_SDL)
add_definitions(-DBUILD_SDL)