mirror of
https://github.com/walterschell/Lua.git
synced 2024-11-21 12:54:35 +00:00
First attempt at testing CMake Pacage. Will be squashed
This commit is contained in:
parent
b4d597e122
commit
e1d13df4a0
17
.github/workflows/build-linux.yml
vendored
17
.github/workflows/build-linux.yml
vendored
@ -43,7 +43,22 @@ jobs:
|
||||
# Execute the build. You can specify a specific target with "--target <NAME>"
|
||||
run: cmake --build . --config $BUILD_TYPE
|
||||
|
||||
- name: Install
|
||||
working-directory: ${{github.workspace}}/build
|
||||
shell: bash
|
||||
run: cmake --install . --prefix $GITHUB_WORKSPACE/sysroot
|
||||
|
||||
- name: Test
|
||||
working-directory: ${{github.workspace}}/build
|
||||
shell: bash
|
||||
run: ctest -V
|
||||
run: ctest -V
|
||||
|
||||
- name: Configure Test of CMake Package
|
||||
working-directory: ${{github.workspace}}
|
||||
shell: bash
|
||||
run: cmake -S $GITHUB_WORKSPACE/lua-config-package-tests -B build-pkg-test -DCMAKE_PREFIX=$GITHUB_WORKSPACE/sysroot
|
||||
|
||||
- name: Build Test of CMake Package
|
||||
working-directory: ${{github.workspace}}
|
||||
shell: bash
|
||||
run: cmake --build build-pkg-test
|
14
lua-config-package-tests/CMakeLists.txt
Normal file
14
lua-config-package-tests/CMakeLists.txt
Normal file
@ -0,0 +1,14 @@
|
||||
cmake_minimum_required(VERSION 3.1)
|
||||
project(lua-config-package-test C)
|
||||
|
||||
find_package(Lua REQUIRED CONFIG)
|
||||
|
||||
add_executable(lua-config-package-build-test-using-static-target "./lua-config-package-build-test.c")
|
||||
target_link_libraries(lua-config-package-build-test-using-static-target Lua::lua_static)
|
||||
|
||||
add_executable(lua-config-package-build-test-using-shared-target "./lua-config-package-build-test.c")
|
||||
target_link_libraries(lua-config-package-build-test-using-shared-target Lua::lua_static)
|
||||
|
||||
add_executable(lua-config-package-build-test-using-variables "./lua-config-package-build-test.c")
|
||||
target_link_libraries(lua-config-package-build-test-using-variables ${LUA_LIBRARIES})
|
||||
|
10
lua-config-package-tests/lua-config-package-build-test.c
Normal file
10
lua-config-package-tests/lua-config-package-build-test.c
Normal file
@ -0,0 +1,10 @@
|
||||
#include <lua.h>
|
||||
#include <lauxlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
lua_State *l = luaL_newstate();
|
||||
double lversion = lua_version(l);
|
||||
printf("Lua version is %f\n", lversion);
|
||||
}
|
Loading…
Reference in New Issue
Block a user