diff options
| author | jussi | 2024-02-10 21:06:09 +0200 |
|---|---|---|
| committer | jussi | 2024-02-10 21:06:09 +0200 |
| commit | 6557a2ebca62c6670736b4ec2914a2aca60dbdba (patch) | |
| tree | 03a839d7eb4b9bddf3a694a163724ca8d59c819e /CMakeLists.txt | |
| parent | eda4eacfce4f62ca09fb4f6559f9b7aeabe3cc31 (diff) | |
| download | reilua-enhanced-6557a2ebca62c6670736b4ec2914a2aca60dbdba.tar.gz reilua-enhanced-6557a2ebca62c6670736b4ec2914a2aca60dbdba.tar.bz2 reilua-enhanced-6557a2ebca62c6670736b4ec2914a2aca60dbdba.zip | |
Build option for Lua events that is off by default.
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" ) |
