Sfoglia il codice sorgente

CMake: accept standard -DBUILD_SHARED_LIBS as well

-DBUILD_SHARED_LIBS=OFF == -DSHARED=OFF -DSTATIC=ON
-DBUILD_SHARED_LIBS=ON  == -DSHARED=ON  -DSTATIC=OFF

Fixes #626.
Ahmad Fatoum 7 anni fa
parent
commit
2981713e4f
1 ha cambiato i file con 8 aggiunte e 0 eliminazioni
  1. 8 0
      src/CMakeOptions.txt

+ 8 - 0
src/CMakeOptions.txt

@@ -84,6 +84,14 @@ if(NOT (STATIC OR SHARED))
   message(FATAL_ERROR "Nothing to do if both -DSHARED=OFF and -DSTATIC=OFF...")
   message(FATAL_ERROR "Nothing to do if both -DSHARED=OFF and -DSTATIC=OFF...")
 endif()
 endif()
 
 
+if (DEFINED BUILD_SHARED_LIBS)
+  set(SHARED ${BUILD_SHARED_LIBS})
+  if (${BUILD_SHARED_LIBS})
+    set(STATIC OFF)
+  else()
+    set(STATIC ON)
+  endif()
+endif()
 if(DEFINED SHARED_RAYLIB)
 if(DEFINED SHARED_RAYLIB)
   set(SHARED ${SHARED_RAYLIB})
   set(SHARED ${SHARED_RAYLIB})
   message(DEPRECATION "-DSHARED_RAYLIB is deprecated. Please use -DSHARED instead.")
   message(DEPRECATION "-DSHARED_RAYLIB is deprecated. Please use -DSHARED instead.")