All: Add static library
Jeffrey Pfau jeffrey@endrift.com
Thu, 12 Feb 2015 02:27:59 -0800
1 files changed,
8 insertions(+),
4 deletions(-)
jump to
M
CMakeLists.txt
→
CMakeLists.txt
@@ -253,7 +253,7 @@ add_definitions(-DENABLE_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 @@ ${UTIL_SRC}
${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)