Quellcode durchsuchen

Don't rename the static library on Windows.

"physfs.lib" will also be the import library's name, so it's best to leave it
separate on that platform.
Ryan C. Gordon vor 8 Jahren
Ursprung
Commit
f2cbac7479
1 geänderte Dateien mit 8 neuen und 2 gelöschten Zeilen
  1. 8 2
      CMakeLists.txt

+ 8 - 2
CMakeLists.txt

@@ -278,7 +278,13 @@ endif()
 option(PHYSFS_BUILD_STATIC "Build static library" TRUE)
 option(PHYSFS_BUILD_STATIC "Build static library" TRUE)
 if(PHYSFS_BUILD_STATIC)
 if(PHYSFS_BUILD_STATIC)
     add_library(physfs-static STATIC ${PHYSFS_SRCS})
     add_library(physfs-static STATIC ${PHYSFS_SRCS})
-    set_target_properties(physfs-static PROPERTIES OUTPUT_NAME "physfs")
+    # Don't rename this on Windows, since DLLs will also produce an import
+    #  library named "physfs.lib" which would conflict; Unix tend to like the
+    #  same library name with a different extension for static libs, but
+    #  Windows can just have a separate name.
+    if(NOT WINDOWS)
+        set_target_properties(physfs-static PROPERTIES OUTPUT_NAME "physfs")
+    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()
@@ -298,7 +304,7 @@ if(NOT PHYSFS_BUILD_SHARED AND NOT PHYSFS_BUILD_STATIC)
 endif()
 endif()
 
 
 # CMake FAQ says I need this...
 # CMake FAQ says I need this...
-if(PHYSFS_BUILD_SHARED AND PHYSFS_BUILD_STATIC)
+if(PHYSFS_BUILD_SHARED AND PHYSFS_BUILD_STATIC AND NOT WINDOWS)
     set_target_properties(physfs PROPERTIES CLEAN_DIRECT_OUTPUT 1)
     set_target_properties(physfs PROPERTIES CLEAN_DIRECT_OUTPUT 1)
     set_target_properties(physfs-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
     set_target_properties(physfs-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
 endif()
 endif()