diff options
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 92a6026..094dd67 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,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 ) enum_option( PLATFORM "Desktop;Desktop_SDL;Web" "Platform to build for." ) @@ -33,6 +34,10 @@ elseif( PLATFORM STREQUAL "Web" ) set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DPLATFORM_WEB" ) endif() +if( LUA_EVENTS ) + set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DLUA_EVENTS" ) +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 ) @@ -77,7 +82,7 @@ else() # Desktop target_link_libraries( ${PROJECT_NAME} ${SDL2_LIBRARIES} ) endif() - if( DRM ) # Mainly 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 ) @@ -87,6 +92,8 @@ else() # Desktop elseif( APPLE ) set( CMAKE_C_COMPILER "clang" ) + # 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" ) |
