summaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAhmad Fatoum <[email protected]>2018-05-10 21:03:43 +0200
committerGitHub <[email protected]>2018-05-10 21:03:43 +0200
commitb8ca51fd01a68b9b6040f8c3c631eedefd7d7735 (patch)
tree8acecde91ef036bf8fbba51c75fb885692b27941 /CMakeLists.txt
parent8ae8d3ac782825d732a0680bd1ad80db420718a9 (diff)
downloadraylib-b8ca51fd01a68b9b6040f8c3c631eedefd7d7735.tar.gz
raylib-b8ca51fd01a68b9b6040f8c3c631eedefd7d7735.zip
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.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--[-rwxr-xr-x]CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6d5994f4..a2f14088 100755..100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -33,6 +33,18 @@ add_if_flag_works(-Werror=implicit-function-declaration CMAKE_C_FLAGS)
# src/external/jar_xm.h does shady stuff
add_if_flag_works(-fno-strict-aliasing CMAKE_C_FLAGS)
+message(STATUS "Check for symlink support in file system")
+execute_process(
+ COMMAND ${CMAKE_COMMAND} -E create_symlink CMakeLists.txt "${CMAKE_CURRENT_BINARY_DIR}/TestingIfSymlinkWorks"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ RESULT_VARIABLE FILESYSTEM_LACKS_SYMLINKS
+)
+If (FILESYSTEM_LACKS_SYMLINKS)
+ message(STATUS "Testing if file system supports symlinks -- unsupported")
+else()
+ message(STATUS "Testing if file system supports symlinks -- supported")
+endif()
+
if (ENABLE_ASAN)
add_if_flag_works(-fno-omit-frame-pointer CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)
add_if_flag_works(-fsanitize=address CMAKE_C_FLAGS CMAKE_LINKER_FLAGS)