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.
This commit is contained in:
Ahmad Fatoum 2018-10-07 19:09:05 +02:00
parent 93f68fa612
commit 2981713e4f
No known key found for this signature in database
GPG Key ID: C3EAC3DE9321D59B
1 changed files with 8 additions and 0 deletions

View File

@ -84,6 +84,14 @@ if(NOT (STATIC OR SHARED))
message(FATAL_ERROR "Nothing to do if both -DSHARED=OFF and -DSTATIC=OFF...")
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)
set(SHARED ${SHARED_RAYLIB})
message(DEPRECATION "-DSHARED_RAYLIB is deprecated. Please use -DSHARED instead.")