CMake: Don't create symlinks on unsupporting file systems (#539)

Panders to the idiosyncrasies of my work flow:
I have my raylib build directory mounted as a VirtualBox vboxfs for use
with my Linux VM, but vboxfs doesn't support symlinks, while raylib shared
library versioning on Unix expects symlinks to work.
If this happens, library versioning is now disabled on Unix with
an error message instead of just failing the build.
This commit is contained in:
Ahmad Fatoum
2018-05-10 21:03:43 +02:00
committed by GitHub
parent 8ae8d3ac78
commit b8ca51fd01
3 changed files with 22 additions and 3 deletions

View File

@@ -101,9 +101,15 @@ if(${PLATFORM} MATCHES "PLATFORM_DESKTOP")
set(CMAKE_MACOSX_RPATH ON)
target_link_libraries(${RAYLIB}_shared ${LIBS_PRIVATE})
if (UNIX AND ${FILESYSTEM_LACKS_SYMLINKS})
MESSAGE(WARNING "Can't version UNIX shared library on file system without symlink support")
else()
set_target_properties(${RAYLIB}_shared PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${API_VERSION}
)
endif()
set_target_properties(${RAYLIB}_shared PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${API_VERSION}
PUBLIC_HEADER "raylib.h"
)
if(WIN32)