Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/linux-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@ jobs:
with:
imageName: ghcr.io/dragonruby/internal-lightstorm-ci
runCmd: |
cmake --preset lightstorm
cmake --build ./build.debug.dir/build -t run-integration-tests
cmake --workflow --preset lightstorm-ubuntu-ci
19 changes: 2 additions & 17 deletions .github/workflows/macos-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,6 @@ jobs:
run: brew install llvm@19 ninja
- name: Install Python dependencies
run: pip install lit filecheck==0.0.24
- name: Set reusable strings
id: strings
shell: bash
- name: Build and test
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Configure CMake
run: |
cmake -G Ninja \
-B ${{ steps.strings.outputs.build-output-dir }} \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_PREFIX_PATH=/opt/homebrew/opt/llvm@19/ \
-DCMAKE_BUILD_TYPE=Release \
-S ${{ github.workspace }}
- name: Build
run: cmake --build ${{ steps.strings.outputs.build-output-dir }}
- name: Test
working-directory: ${{ steps.strings.outputs.build-output-dir }}
run: ninja run-integration-tests
cmake --workflow --preset lightstorm-macos-ci
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Output
build*dir
install*dir
*.lit_test_times.txt
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
cmake_minimum_required(VERSION 3.27)
project(LightStorm)
project(lightstorm)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

include(GNUInstallDirs)

include(cmake/mruby.cmake)
include(cmake/lightstorm.cmake)

Expand Down
111 changes: 104 additions & 7 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,115 @@
"version": 8,
"configurePresets": [
{
"name": "lightstorm",
"displayName": "lightstorm",
"description": "Sets Ninja generator, build and install directory",
"name": "lightstorm-defaults",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build.debug.dir/build",
"binaryDir": "${sourceDir}/build.dir",
"installDir": "${sourceDir}/install.dir",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "lightstorm-ubuntu",
"inherits": "lightstorm-defaults",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_C_COMPILER": "clang-19",
"CMAKE_CXX_COMPILER": "clang++-19",
"CMAKE_PREFIX_PATH": "/usr/lib/llvm-19/lib/cmake",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build.debug.dir/install"
"CMAKE_PREFIX_PATH": "/usr/lib/llvm-19/lib/cmake"
}
},
{
"name": "lightstorm-macos",
"inherits": "lightstorm-defaults",
"cacheVariables": {
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++",
"CMAKE_PREFIX_PATH": "/opt/homebrew/opt/llvm@19"
}
}
],
"buildPresets": [
{
"name": "lightstorm-ubuntu",
"configurePreset": "lightstorm-ubuntu"
},
{
"name": "lightstorm-ubuntu-tests",
"inherits": "lightstorm-ubuntu",
"targets": "run-integration-tests"
},
{
"name": "lightstorm-ubuntu-install",
"inherits": "lightstorm-ubuntu",
"targets": "install"
},
{
"name": "lightstorm-macos",
"configurePreset": "lightstorm-macos"
},
{
"name": "lightstorm-macos-tests",
"inherits": "lightstorm-macos",
"targets": "run-integration-tests"
},
{
"name": "lightstorm-macos-install",
"inherits": "lightstorm-macos",
"targets": "install"
}
],
"workflowPresets": [
{
"name": "lightstorm-ubuntu-ci",
"steps": [
{
"type": "configure",
"name": "lightstorm-ubuntu"
},
{
"type": "build",
"name": "lightstorm-ubuntu-tests"
}
]
},
{
"name": "lightstorm-ubuntu-install",
"steps": [
{
"type": "configure",
"name": "lightstorm-ubuntu"
},
{
"type": "build",
"name": "lightstorm-ubuntu-install"
}
]
},
{
"name": "lightstorm-macos-ci",
"steps": [
{
"type": "configure",
"name": "lightstorm-macos"
},
{
"type": "build",
"name": "lightstorm-macos-tests"
}
]
},
{
"name": "lightstorm-macos-install",
"steps": [
{
"type": "configure",
"name": "lightstorm-macos"
},
{
"type": "build",
"name": "lightstorm-macos-install"
}
]
}
]
}
12 changes: 12 additions & 0 deletions cmake/mruby.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,23 @@ ExternalProject_Add(
add_executable(mruby_binary IMPORTED GLOBAL)
set_property(TARGET mruby_binary PROPERTY IMPORTED_LOCATION ${MRUBY_BINARY})
add_dependencies(mruby_binary mruby)
install(
FILES $<TARGET_FILE:mruby_binary>
DESTINATION ${CMAKE_INSTALL_BINDIR}
RENAME lightstorm-mruby)

add_executable(mrbc_binary IMPORTED GLOBAL)
set_property(TARGET mrbc_binary PROPERTY IMPORTED_LOCATION ${MRBC_BINARY})
add_dependencies(mrbc_binary mruby)
install(
FILES $<TARGET_FILE:mrbc_binary>
DESTINATION ${CMAKE_INSTALL_BINDIR}
RENAME lightstorm-mrbc)

add_library(mruby_static STATIC IMPORTED GLOBAL)
set_property(TARGET mruby_static PROPERTY IMPORTED_LOCATION ${MRUBY_STATIC})
add_dependencies(mruby_static mruby)
install(
FILES $<TARGET_FILE:mruby_static>
DESTINATION ${CMAKE_INSTALL_LIBDIR}
RENAME liblightstorm_mruby.a)
2 changes: 2 additions & 0 deletions lib/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ target_compile_options(lightstorm_runtime_main PRIVATE ${LIGHTSTORM_CFLAGS})
target_link_options(lightstorm_runtime_main PRIVATE ${LIGHTSTORM_CFLAGS})
target_link_libraries(lightstorm_runtime_main PUBLIC m)
add_dependencies(lightstorm_runtime_main mruby_static)
install(TARGETS lightstorm_runtime_main)
install(FILES lightstorm_runtime.c DESTINATION ${CMAKE_INSTALL_LIBDIR})