Permalink
Browse files

Updated to luarocks version of the package to avoid minor diffrerence…

…s between the packages
  • Loading branch information...
drahosp committed Nov 6, 2012
1 parent f599900 commit c0e6a75c357eaefa9bc58426af3e9bb71228851b
Showing with 32 additions and 18 deletions.
  1. +3 −2 .travis.yml
  2. +1 −1 alt_getopt
  3. +4 −7 alt_getopt.lua
  4. +24 −8 cmake/lua.cmake
View
@@ -4,11 +4,12 @@
# We assume C build environments
language: C
-
+
# Try using multiple Lua Implementations
env:
- TOOL="" # Use native compiler (GCC usually)
- COMPILER="clang" # Use clang
+# - COMPILER="fortran" # Use fortran, make sure to modify the matrix section
- TOOL="i686-w64-mingw32" # 32bit MinGW
- TOOL="x86_64-w64-mingw32" # 64bit MinGW
- TOOL="arm-linux-gnueabihf" # ARM hard-float (hf), linux
@@ -48,4 +49,4 @@ notifications:
- luadist-dev@googlegroups.com
email:
on_success: change
- on_failure: always
+ on_failure: always
View
@@ -1,6 +1,6 @@
#!/usr/bin/env lua
-local alt_getopt = require "alt_getopt"
+require "alt_getopt"
local long_opts = {
verbose = "v",
View
@@ -21,6 +21,8 @@
local type, pairs, ipairs, io, os = type, pairs, ipairs, io, os
+module ("alt_getopt")
+
local function convert_short2long (opts)
local i = 1
local len = #opts
@@ -59,7 +61,7 @@ local function canonize (options, opt)
return opt
end
-local function get_ordered_opts (arg, sh_opts, long_opts)
+function get_ordered_opts (arg, sh_opts, long_opts)
local i = 1
local count = 1
local opts = {}
@@ -148,7 +150,7 @@ local function get_ordered_opts (arg, sh_opts, long_opts)
return opts,i,optarg
end
-local function get_opts (arg, sh_opts, long_opts)
+function get_opts (arg, sh_opts, long_opts)
local ret = {}
local opts,optind,optarg = get_ordered_opts (arg, sh_opts, long_opts)
@@ -162,8 +164,3 @@ local function get_opts (arg, sh_opts, long_opts)
return ret,optind
end
-
-return {
- get_ordered_opts = get_ordered_opts,
- get_opts = get_opts,
-}
View
@@ -11,8 +11,9 @@ set ( INSTALL_LMOD ${INSTALL_LIB}/lua
set ( INSTALL_CMOD ${INSTALL_LIB}/lua
CACHE PATH "Directory to install Lua binary modules." )
-option ( SKIP_LUA_WRAPPER
- "Do not build and install Lua executable wrappers." OFF)
+option ( LUA_SKIP_WRAPPER
+ "Do not build and install Lua executable wrappers." OFF )
+option ( LUA_STATIC_MODULE "Build modules for static linking" OFF )
# List of (Lua module name, file path) pairs.
# Used internally by add_lua_test. Built by add_lua_module.
@@ -124,13 +125,28 @@ macro ( _lua_module_helper is_install _name )
list ( APPEND _lua_modules "${_thisname}"
"${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_CFG_INTDIR}/${_module}" )
endforeach ()
-
- add_library( ${_target} MODULE ${_MODULE_SRC})
- target_link_libraries ( ${_target} ${LUA_LIBRARY} ${_MODULE_LINK} )
- set_target_properties ( ${_target} PROPERTIES LIBRARY_OUTPUT_DIRECTORY
- "${_module_dir}" PREFIX "" OUTPUT_NAME "${_module_filenamebase}" )
+
+ # Static module (not linking to lua)
+ if ( LUA_STATIC_MODULE )
+ add_library( ${_target} STATIC ${_MODULE_SRC})
+ target_link_libraries ( ${_target} ${_MODULE_LINK} )
+ else ()
+ # Dynamic module
+ add_library( ${_target} MODULE ${_MODULE_SRC})
+ target_link_libraries ( ${_target} ${LUA_LIBRARY} ${_MODULE_LINK} )
+ endif ()
+
+ set_target_properties ( ${_target} PROPERTIES
+ ARCHIVE_OUTPUT_DIRECTORY "${_module_dir}"
+ LIBRARY_OUTPUT_DIRECTORY "${_module_dir}"
+ PREFIX ""
+ OUTPUT_NAME "${_module_filenamebase}" )
if ( ${is_install} )
- install ( TARGETS ${_target} DESTINATION ${INSTALL_CMOD}/${_module_dir} COMPONENT Runtime)
+ install ( TARGETS ${_target}
+ LIBRARY DESTINATION ${INSTALL_CMOD}/${_module_dir}
+ COMPONENT Runtime
+ ARCHIVE DESTINATION ${INSTALL_CMOD}/${_module_dir}
+ COMPONENT Library )
endif ()
endif ()
endmacro ()

2 comments on commit c0e6a75

This commit reverts the commit 86eb438 (Updated lua 5.2 compatibility) and removes the Lua 5.2+ support again. Was that intentional?

Owner

drahosp replied Jul 23, 2015

Probably not, thanks for noticing. As for the support for the module, LuaDist will soon use LuaRocks rockspec modules and only libraries and special modules will be in the LuaDist repository. This alt-getopt repo will soon be obsolete.

Please sign in to comment.