Skip to content

Commit beb0f8b

Browse files
authored
Merge pull request #8 from DragonRuby/alexdenisov/installation
Install more stuff
2 parents c96b4eb + 2716d14 commit beb0f8b

File tree

7 files changed

+125
-27
lines changed

7 files changed

+125
-27
lines changed

.github/workflows/linux-ci.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@ jobs:
1818
with:
1919
imageName: ghcr.io/dragonruby/internal-lightstorm-ci
2020
runCmd: |
21-
cmake --preset lightstorm
22-
cmake --build ./build.debug.dir/build -t run-integration-tests
21+
cmake --workflow --preset lightstorm-ubuntu-ci

.github/workflows/macos-ci.yml

+2-17
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,6 @@ jobs:
1515
run: brew install llvm@19 ninja
1616
- name: Install Python dependencies
1717
run: pip install lit filecheck==0.0.24
18-
- name: Set reusable strings
19-
id: strings
20-
shell: bash
18+
- name: Build and test
2119
run: |
22-
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
23-
- name: Configure CMake
24-
run: |
25-
cmake -G Ninja \
26-
-B ${{ steps.strings.outputs.build-output-dir }} \
27-
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
28-
-DCMAKE_PREFIX_PATH=/opt/homebrew/opt/llvm@19/ \
29-
-DCMAKE_BUILD_TYPE=Release \
30-
-S ${{ github.workspace }}
31-
- name: Build
32-
run: cmake --build ${{ steps.strings.outputs.build-output-dir }}
33-
- name: Test
34-
working-directory: ${{ steps.strings.outputs.build-output-dir }}
35-
run: ninja run-integration-tests
20+
cmake --workflow --preset lightstorm-macos-ci

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
Output
22
build*dir
3+
install*dir
34
*.lit_test_times.txt

CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
cmake_minimum_required(VERSION 3.27)
2-
project(LightStorm)
2+
project(lightstorm)
33

44
set(CMAKE_CXX_STANDARD 20)
55
set(CMAKE_CXX_STANDARD_REQUIRED ON)
66
set(CMAKE_CXX_EXTENSIONS OFF)
77

8+
include(GNUInstallDirs)
9+
810
include(cmake/mruby.cmake)
911
include(cmake/lightstorm.cmake)
1012

CMakePresets.json

+104-7
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,115 @@
22
"version": 8,
33
"configurePresets": [
44
{
5-
"name": "lightstorm",
6-
"displayName": "lightstorm",
7-
"description": "Sets Ninja generator, build and install directory",
5+
"name": "lightstorm-defaults",
86
"generator": "Ninja",
9-
"binaryDir": "${sourceDir}/build.debug.dir/build",
7+
"binaryDir": "${sourceDir}/build.dir",
8+
"installDir": "${sourceDir}/install.dir",
9+
"cacheVariables": {
10+
"CMAKE_BUILD_TYPE": "Release"
11+
}
12+
},
13+
{
14+
"name": "lightstorm-ubuntu",
15+
"inherits": "lightstorm-defaults",
1016
"cacheVariables": {
11-
"CMAKE_BUILD_TYPE": "Debug",
1217
"CMAKE_C_COMPILER": "clang-19",
1318
"CMAKE_CXX_COMPILER": "clang++-19",
14-
"CMAKE_PREFIX_PATH": "/usr/lib/llvm-19/lib/cmake",
15-
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build.debug.dir/install"
19+
"CMAKE_PREFIX_PATH": "/usr/lib/llvm-19/lib/cmake"
1620
}
21+
},
22+
{
23+
"name": "lightstorm-macos",
24+
"inherits": "lightstorm-defaults",
25+
"cacheVariables": {
26+
"CMAKE_C_COMPILER": "clang",
27+
"CMAKE_CXX_COMPILER": "clang++",
28+
"CMAKE_PREFIX_PATH": "/opt/homebrew/opt/llvm@19"
29+
}
30+
}
31+
],
32+
"buildPresets": [
33+
{
34+
"name": "lightstorm-ubuntu",
35+
"configurePreset": "lightstorm-ubuntu"
36+
},
37+
{
38+
"name": "lightstorm-ubuntu-tests",
39+
"inherits": "lightstorm-ubuntu",
40+
"targets": "run-integration-tests"
41+
},
42+
{
43+
"name": "lightstorm-ubuntu-install",
44+
"inherits": "lightstorm-ubuntu",
45+
"targets": "install"
46+
},
47+
{
48+
"name": "lightstorm-macos",
49+
"configurePreset": "lightstorm-macos"
50+
},
51+
{
52+
"name": "lightstorm-macos-tests",
53+
"inherits": "lightstorm-macos",
54+
"targets": "run-integration-tests"
55+
},
56+
{
57+
"name": "lightstorm-macos-install",
58+
"inherits": "lightstorm-macos",
59+
"targets": "install"
60+
}
61+
],
62+
"workflowPresets": [
63+
{
64+
"name": "lightstorm-ubuntu-ci",
65+
"steps": [
66+
{
67+
"type": "configure",
68+
"name": "lightstorm-ubuntu"
69+
},
70+
{
71+
"type": "build",
72+
"name": "lightstorm-ubuntu-tests"
73+
}
74+
]
75+
},
76+
{
77+
"name": "lightstorm-ubuntu-install",
78+
"steps": [
79+
{
80+
"type": "configure",
81+
"name": "lightstorm-ubuntu"
82+
},
83+
{
84+
"type": "build",
85+
"name": "lightstorm-ubuntu-install"
86+
}
87+
]
88+
},
89+
{
90+
"name": "lightstorm-macos-ci",
91+
"steps": [
92+
{
93+
"type": "configure",
94+
"name": "lightstorm-macos"
95+
},
96+
{
97+
"type": "build",
98+
"name": "lightstorm-macos-tests"
99+
}
100+
]
101+
},
102+
{
103+
"name": "lightstorm-macos-install",
104+
"steps": [
105+
{
106+
"type": "configure",
107+
"name": "lightstorm-macos"
108+
},
109+
{
110+
"type": "build",
111+
"name": "lightstorm-macos-install"
112+
}
113+
]
17114
}
18115
]
19116
}

cmake/mruby.cmake

+12
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,23 @@ ExternalProject_Add(
2020
add_executable(mruby_binary IMPORTED GLOBAL)
2121
set_property(TARGET mruby_binary PROPERTY IMPORTED_LOCATION ${MRUBY_BINARY})
2222
add_dependencies(mruby_binary mruby)
23+
install(
24+
FILES $<TARGET_FILE:mruby_binary>
25+
DESTINATION ${CMAKE_INSTALL_BINDIR}
26+
RENAME lightstorm-mruby)
2327

2428
add_executable(mrbc_binary IMPORTED GLOBAL)
2529
set_property(TARGET mrbc_binary PROPERTY IMPORTED_LOCATION ${MRBC_BINARY})
2630
add_dependencies(mrbc_binary mruby)
31+
install(
32+
FILES $<TARGET_FILE:mrbc_binary>
33+
DESTINATION ${CMAKE_INSTALL_BINDIR}
34+
RENAME lightstorm-mrbc)
2735

2836
add_library(mruby_static STATIC IMPORTED GLOBAL)
2937
set_property(TARGET mruby_static PROPERTY IMPORTED_LOCATION ${MRUBY_STATIC})
3038
add_dependencies(mruby_static mruby)
39+
install(
40+
FILES $<TARGET_FILE:mruby_static>
41+
DESTINATION ${CMAKE_INSTALL_LIBDIR}
42+
RENAME liblightstorm_mruby.a)

lib/runtime/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ target_compile_options(lightstorm_runtime_main PRIVATE ${LIGHTSTORM_CFLAGS})
88
target_link_options(lightstorm_runtime_main PRIVATE ${LIGHTSTORM_CFLAGS})
99
target_link_libraries(lightstorm_runtime_main PUBLIC m)
1010
add_dependencies(lightstorm_runtime_main mruby_static)
11+
install(TARGETS lightstorm_runtime_main)
12+
install(FILES lightstorm_runtime.c DESTINATION ${CMAKE_INSTALL_LIBDIR})

0 commit comments

Comments
 (0)