From af2bf6f7a248d9b6e78305b4ac9dbc72d2d41ef0 Mon Sep 17 00:00:00 2001 From: jussi Date: Tue, 20 Aug 2024 19:32:38 +0300 Subject: Expose dynamic symbols build option. --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a38a2b9..088d3e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,7 @@ set( CMAKE_C_STANDARD 99 ) # Requires C99 standard option( SHARED "Build using dynamic libraries." off ) option( LUAJIT "Use LuaJIT." off ) option( LUA_EVENTS "Enable Lua event callbacks (RL.event)." off ) +option( DYNAMIC_SYMBOLS "Expose dynamic symbols with rdynamic." off ) enum_option( PLATFORM "Desktop;Desktop_SDL;Web" "Platform to build for." ) @@ -38,6 +39,10 @@ if( LUA_EVENTS ) set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DLUA_EVENTS" ) endif() +if( DYNAMIC_SYMBOLS ) + set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -rdynamic" ) +endif() + if( PLATFORM STREQUAL "Web" ) target_link_libraries( ${PROJECT_NAME} ${CMAKE_SOURCE_DIR}/lib/web/libraylib.a ) target_link_libraries( ${PROJECT_NAME} ${CMAKE_SOURCE_DIR}/lib/web/liblua.a ) @@ -75,8 +80,6 @@ else() # Desktop if( UNIX ) set( CMAKE_C_COMPILER "gcc" ) - # set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall" ) - if ( PLATFORM MATCHES "Desktop_SDL" ) include( FindPkgConfig ) pkg_search_module( SDL2 REQUIRED sdl2 ) -- cgit v1.2.3