diff --git a/CMakeLists.txt b/CMakeLists.txt index 060b19ec3..c939f8063 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,6 +71,7 @@ option(USE_LIBAO "Build with AO support" ON) option(USE_OSS "Build with OSS support" OFF) option(USE_PULSEAUDIO "Build with PulseAudio support" ON) option(USE_BREAKPAD "Build and link with breakpad library" ON) +option(USE_LUA "Build with Lua support" ON) option(ENABLE_GDB_SERVER "Build with GDB debugging support" OFF) option(ENABLE_DC_PROFILER "Build with support for target machine (SH4) profiler" OFF) option(ENABLE_FC_PROFILER "Build with support for host app (Flycast) profiler" OFF) @@ -473,12 +474,14 @@ if(NOT LIBRETRO) target_link_libraries(${PROJECT_NAME} PRIVATE ZLIB::ZLIB) endif() - find_package(Lua 5.2) - if(NOT APPLE AND LUA_FOUND) - target_compile_definitions(${PROJECT_NAME} PRIVATE USE_LUA) - target_include_directories(${PROJECT_NAME} PRIVATE ${LUA_INCLUDE_DIR} core/deps/luabridge/Source) - list(TRANSFORM LUA_LIBRARIES REPLACE "\.dll" "") - target_link_libraries(${PROJECT_NAME} PRIVATE ${LUA_LIBRARIES}) + if(USE_LUA) + find_package(Lua 5.2) + if(NOT APPLE AND LUA_FOUND) + target_compile_definitions(${PROJECT_NAME} PRIVATE USE_LUA) + target_include_directories(${PROJECT_NAME} PRIVATE ${LUA_INCLUDE_DIR} core/deps/luabridge/Source) + list(TRANSFORM LUA_LIBRARIES REPLACE "\.dll" "") + target_link_libraries(${PROJECT_NAME} PRIVATE ${LUA_LIBRARIES}) + endif() endif() endif()