Parcourir la source

do not attempt to build lua if disabled

Felix Fietkau il y a 13 ans
Parent
commit
0b39b5637a
1 fichiers modifiés avec 16 ajouts et 11 suppressions
  1. 16 11
      lua/CMakeLists.txt

+ 16 - 11
lua/CMakeLists.txt

@@ -19,18 +19,23 @@ IF(NOT LUAPATH)
 		OUTPUT_STRIP_TRAILING_WHITESPACE
 	)
 
-	IF(NOT ${LUA_CHECK_RES} EQUAL 0 OR ${LUAPATH} EQUAL "")
-		MESSAGE(SEND_ERROR "Lua was not found on your system")
+	IF(BUILD_LUA)
+		IF(NOT ${LUA_CHECK_RES} EQUAL 0 OR ${LUAPATH} EQUAL "")
+			MESSAGE(SEND_ERROR "Lua was not found on your system")
+		ENDIF()
 	ENDIF()
 ENDIF()
 
-ADD_LIBRARY(uci_lua MODULE uci.c)
-SET_TARGET_PROPERTIES(uci_lua PROPERTIES
-	OUTPUT_NAME uci
-	PREFIX ""
-)
-TARGET_LINK_LIBRARIES(uci_lua uci dl)
+IF(BUILD_LUA)
+	ADD_LIBRARY(uci_lua MODULE uci.c)
+	SET_TARGET_PROPERTIES(uci_lua PROPERTIES
+		OUTPUT_NAME uci
+		PREFIX ""
+	)
+	TARGET_LINK_LIBRARIES(uci_lua uci dl)
+
+	INSTALL(TARGETS uci_lua
+		LIBRARY DESTINATION ${LUAPATH}
+	)
+ENDIF()
 
-INSTALL(TARGETS uci_lua
-	LIBRARY DESTINATION ${LUAPATH}
-)