Fixed building for WinRT via CMake.

This commit is contained in:
Ryan C. Gordon 2017-07-25 19:55:08 -04:00
parent 1e2650b6fc
commit f578f85557
1 changed files with 11 additions and 0 deletions

View File

@ -49,6 +49,10 @@ if(HAIKU)
endif() endif()
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
set(WINRT TRUE)
endif()
if(WINRT)
set(PHYSFS_CPP_SRCS src/physfs_platform_winrt.cpp) set(PHYSFS_CPP_SRCS src/physfs_platform_winrt.cpp)
endif() endif()
@ -153,6 +157,10 @@ if(PHYSFS_BUILD_STATIC)
if(NOT WINDOWS) if(NOT WINDOWS)
set_target_properties(physfs-static PROPERTIES OUTPUT_NAME "physfs") set_target_properties(physfs-static PROPERTIES OUTPUT_NAME "physfs")
endif() endif()
if(WINRT)
set_target_properties(physfs-static PROPERTIES VS_WINRT_COMPONENT True)
endif()
set(PHYSFS_LIB_TARGET physfs-static) set(PHYSFS_LIB_TARGET physfs-static)
set(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";physfs-static") set(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";physfs-static")
endif() endif()
@ -162,6 +170,9 @@ if(PHYSFS_BUILD_SHARED)
add_library(physfs SHARED ${PHYSFS_SRCS}) add_library(physfs SHARED ${PHYSFS_SRCS})
set_target_properties(physfs PROPERTIES VERSION ${PHYSFS_VERSION}) set_target_properties(physfs PROPERTIES VERSION ${PHYSFS_VERSION})
set_target_properties(physfs PROPERTIES SOVERSION ${PHYSFS_SOVERSION}) set_target_properties(physfs PROPERTIES SOVERSION ${PHYSFS_SOVERSION})
if(WINRT)
set_target_properties(physfs PROPERTIES VS_WINRT_COMPONENT True)
endif()
target_link_libraries(physfs ${OPTIONAL_LIBRARY_LIBS} ${OTHER_LDFLAGS}) target_link_libraries(physfs ${OPTIONAL_LIBRARY_LIBS} ${OTHER_LDFLAGS})
set(PHYSFS_LIB_TARGET physfs) set(PHYSFS_LIB_TARGET physfs)
set(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";physfs") set(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";physfs")