all repos — mgba @ 2d04d03d32aa433fba030cda907d1e2a7b9e6f79

mGBA Game Boy Advance Emulator

CMake: Fix Windows static build
Vicki Pfau vi@endrift.com
Sat, 22 Jun 2019 10:35:21 -0700
commit

2d04d03d32aa433fba030cda907d1e2a7b9e6f79

parent

98d2671c6d90e662b50e676921ef431dc0b20979

1 files changed, 3 insertions(+), 1 deletions(-)

jump to
M CMakeLists.txtCMakeLists.txt

@@ -785,6 +785,7 @@ source_group("Extra features" FILES ${FEATURE_SRC})

source_group("Third-party code" FILES ${THIRD_PARTY_SRC}) # Platform binaries +set(OS_DEFINES) if(DEFINED 3DS) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/platform/3ds ${CMAKE_CURRENT_BINARY_DIR}/3ds) endif()

@@ -841,12 +842,13 @@ add_library(${BINARY_NAME} SHARED ${SRC} ${VFS_SRC})

if(BUILD_STATIC) add_library(${BINARY_NAME}-static STATIC ${SRC}) target_include_directories(${BINARY_NAME}-static BEFORE PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_BINARY_DIR}/include) - set_target_properties(${BINARY_NAME}-static PROPERTIES COMPILE_DEFINITIONS "${OS_DEFINES};${FEATURE_DEFINES};${FUNCTION_DEFINES}" COMPILE_OPTIONS "${FEATURE_FLAGS}") + set_target_properties(${BINARY_NAME}-static PROPERTIES COMPILE_DEFINITIONS "${OS_DEFINES};${FEATURE_DEFINES};${FUNCTION_DEFINES};BUILD_STATIC" COMPILE_OPTIONS "${FEATURE_FLAGS}") install(TARGETS ${BINARY_NAME}-static DESTINATION ${LIBDIR} COMPONENT lib${BINARY_NAME}) add_dependencies(${BINARY_NAME}-static version-info) endif() else() add_library(${BINARY_NAME} STATIC ${SRC}) + list(APPEND OS_DEFINES BUILD_STATIC) endif() file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/mgba-util)