Fixed building for WinRT via CMake.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 25 Jul 2017 19:55:08 -0400
changeset 1519 3edf28828371
parent 1518 a6ac19814d53
child 1520 3bb4dd63efa2
Fixed building for WinRT via CMake.
CMakeLists.txt
--- a/CMakeLists.txt	Mon Jul 24 03:29:33 2017 -0400
+++ b/CMakeLists.txt	Tue Jul 25 19:55:08 2017 -0400
@@ -49,6 +49,10 @@
 endif()
 
 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)
 endif()
 
@@ -153,6 +157,10 @@
     if(NOT WINDOWS)
         set_target_properties(physfs-static PROPERTIES OUTPUT_NAME "physfs")
     endif()
+    if(WINRT)
+		set_target_properties(physfs-static PROPERTIES VS_WINRT_COMPONENT True)
+    endif()
+
     set(PHYSFS_LIB_TARGET physfs-static)
     set(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";physfs-static")
 endif()
@@ -162,6 +170,9 @@
     add_library(physfs SHARED ${PHYSFS_SRCS})
     set_target_properties(physfs PROPERTIES VERSION ${PHYSFS_VERSION})
     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})
     set(PHYSFS_LIB_TARGET physfs)
     set(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";physfs")