Hide unneeded internal symbols when building raylib as an so or dylib (#3573)

This commit is contained in:
Peter0x44
2023-11-28 19:43:45 +00:00
committed by GitHub
parent fe53ba80dd
commit e7a486fa81
7 changed files with 47 additions and 24 deletions

View File

@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0)
project(raylib)
# Avoid excessive expansion of variables in conditionals. In particular, if
# "PLATFORM" is "DRM" than:
# "PLATFORM" is "DRM" then:
#
# if (${PLATFORM} MATCHES "DRM")
#
@ -13,6 +13,11 @@ project(raylib)
# See https://cmake.org/cmake/help/latest/policy/CMP0054.html
cmake_policy(SET CMP0054 NEW)
# Makes a hidden visibility preset on a static lib respected
# This is used to hide glfw's symbols from the library exports when building an so/dylib
# See https://cmake.org/cmake/help/latest/policy/CMP0063.html
cmake_policy(SET CMP0063 NEW)
# Directory for easier includes
# Anywhere you see include(...) you can check <root>/cmake for that file
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)