Added cmake

This commit is contained in:
Rafał Grodziński
2025-06-21 00:03:35 +09:00
parent d24fd05a7a
commit a1bb97a597
4 changed files with 27 additions and 3 deletions

3
.gitignore vendored
View File

@@ -3,4 +3,5 @@
brb brb
.vscode/settings.json .vscode/settings.json
*.dSYM *.dSYM
*.brc *.brc
build/

1
.vscode/launch.json vendored
View File

@@ -9,6 +9,5 @@
"args": ["-v", "${workspaceFolder}/test.brc"], "args": ["-v", "${workspaceFolder}/test.brc"],
"internalConsoleOptions": "openOnSessionStart" "internalConsoleOptions": "openOnSessionStart"
} }
] ]
} }

11
.vscode/tasks.json vendored
View File

@@ -4,11 +4,20 @@
{ {
"label": "Build Bits Runner Builder", "label": "Build Bits Runner Builder",
"type": "shell", "type": "shell",
"command": "./make.sh", "command": "cmake --build build",
"group": { "group": {
"kind": "build", "kind": "build",
"isDefault": true "isDefault": true
} }
},
{
"label": "Clean built product",
"type": "shell",
"command": "cmake --build build --target clean",
"group": {
"kind": "none",
"isDefault": false
}
} }
] ]
} }

15
CMakeLists.txt Normal file
View File

@@ -0,0 +1,15 @@
cmake_minimum_required(VERSION 4.0)
project(bits-runner-builder LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
find_package(LLVM REQUIRED CONFIG)
include_directories(${LLVM_INCLUDE_DIRS})
link_directories(${LLVM_LIBRARY_DIRS})
file(GLOB_RECURSE SOURCES
src/*.cpp
src/**/*.cpp)
add_executable(brb ${SOURCES})
target_link_libraries(brb llvm)