summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt21
1 files changed, 16 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 088d3e9..09e7b10 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,7 +13,8 @@ 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 )
+option( DYNAMIC_SYMBOLS "Expose all dynamic symbols with rdynamic." off )
+option( EXPOSE_API_SYMBOLS "Expose dynamic symbols only for get and push functions of variable types." off )
enum_option( PLATFORM "Desktop;Desktop_SDL;Web" "Platform to build for." )
@@ -61,6 +62,7 @@ else() # Desktop
target_link_libraries( ${PROJECT_NAME} raylib )
if( LUAJIT )
+ set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DLUAJIT" )
target_link_libraries( ${PROJECT_NAME} luajit )
else()
target_link_libraries( ${PROJECT_NAME} lua )
@@ -80,6 +82,10 @@ else() # Desktop
if( UNIX )
set( CMAKE_C_COMPILER "gcc" )
+ if( EXPOSE_API_SYMBOLS )
+ set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DEXPOSE_LUA_API_SYMBOLS -rdynamic -fvisibility=hidden" )
+ endif()
+
if ( PLATFORM MATCHES "Desktop_SDL" )
include( FindPkgConfig )
pkg_search_module( SDL2 REQUIRED sdl2 )
@@ -87,29 +93,34 @@ else() # Desktop
target_link_libraries( ${PROJECT_NAME} ${SDL2_LIBRARIES} )
endif()
- if( DRM ) # For Raspberry Pi
+ if( DRM ) # For Raspberry Pi.
# target_link_libraries( ${PROJECT_NAME} GLESv2 EGL drm gbm rt bcm_host m dl pthread )
# target_link_libraries( ${PROJECT_NAME} GLESv2 EGL drm gbm pthread rt m dl )
target_link_libraries( ${PROJECT_NAME} raylib GLESv2 EGL pthread rt m gbm drm dl atomic )
else()
- target_link_libraries( ${PROJECT_NAME} m dl pthread )
+ # target_link_libraries( ${PROJECT_NAME} m dl pthread )
+ target_link_libraries( ${PROJECT_NAME} m dl pthread glfw )
endif()
elseif( APPLE )
set( CMAKE_C_COMPILER "clang" )
- # TODO Linking to sdl2.
+ # //TODO Linking to sdl2.
target_link_libraries( ${PROJECT_NAME} "-framework IOKit" )
target_link_libraries( ${PROJECT_NAME} "-framework Cocoa" )
target_link_libraries( ${PROJECT_NAME} "-framework OpenGL" )
elseif( WIN32 )
+ if( EXPOSE_API_SYMBOLS )
+ set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DEXPOSE_LUA_API_SYMBOLS" )
+ endif()
+
if ( PLATFORM MATCHES "Desktop_SDL" )
find_package( SDL2 REQUIRED )
include_directories( ${SDL2_INCLUDE_DIRS} )
target_link_libraries( ${PROJECT_NAME} ${SDL2MAIN_LIBRARIES} )
target_link_libraries( ${PROJECT_NAME} ${SDL2_LIBRARIES} )
endif()
- # Remove this to get console.
+ # Remove this to get console. //TODO Could be build option.
set( CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "-mwindows" )
target_link_libraries( ${PROJECT_NAME} mingw32 opengl32 gdi32 winmm )
endif()