Skip to content

Commit

Permalink
Add vscode and CMake support
Browse files Browse the repository at this point in the history
  • Loading branch information
MaJerle committed Dec 13, 2021
1 parent e0c0bad commit 50abc6f
Show file tree
Hide file tree
Showing 5 changed files with 157 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@
*.uvoptx
*.__i
*.i
*.txt
!docs/*.txt
!CMakeLists.txt
RTE/

*debug

# IAR Settings
**/settings/*.crun
**/settings/*.dbgdt
Expand Down Expand Up @@ -68,13 +72,15 @@ RTE/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
[Dd]ebug*/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
_build/
build/

# Visual Studio 2015/2017 cache/options directory
.vs/
Expand Down Expand Up @@ -382,3 +388,13 @@ log_file.txt
project.ioc
mx.scratch
*.tilen majerle


# Altium
Project outputs*
History/
*.SchDocPreview
*.$$$Preview

# VSCode projects
project_vscode_compiled.exe
25 changes: 25 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"version": 4,
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}\\dev\\VisualStudio\\",
"${workspaceFolder}\\lwrb\\src\\include\\",
"${workspaceFolder}\\"
],
"defines": [
"WIN32",
"_DEBUG",
"UNICODE",
"_UNICODE",
"LWESP_DEV"
],
"compilerPath": "c:\\msys64\\mingw64\\bin\\gcc.exe",
"cStandard": "gnu17",
"cppStandard": "gnu++14",
"intelliSenseMode": "windows-gcc-x86",
"configurationProvider": "ms-vscode.cmake-tools"
}
]
}
20 changes: 20 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(Windows) Launch",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}\\build\\LwLibPROJECT.exe",
"miDebuggerPath": "c:\\msys64\\mingw64\\bin\\gdb.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"console": "integratedTerminal"
}
]
}
70 changes: 70 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"version": "2.0.0",

/* For this builds, you need
*
* - Ninja build system
* - MSYS2 compiler with ninja support
* - C/C++ extension for VSCode
* - CMake-Tools extension for VSCode
*/
"tasks": [
{
"type": "cppbuild",
"label": "Build project",
"command": "cmake",
"args": [
"--build",
"\"build\""
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "shell",
"label": "Rebuild project",
"command": "cmake",
"args": [
"--build",
"\"build\"",
"--clean-first"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
},
{
"type": "shell",
"label": "Clean project",
"command": "cmake",
"args": [
"--build",
"\"build\"",
"--target",
"clean"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": []
},
{
"type": "shell",
"label": "Run application",
"command": "${workspaceFolder}\\build\\LwLibPROJECT.exe",
"args": [],
"problemMatcher": [],
},
]
}
26 changes: 26 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
cmake_minimum_required(VERSION 3.0.0)
project(LwLibPROJECT VERSION 0.1.0)

include(CTest)
enable_testing()

add_executable(${PROJECT_NAME}
lwrb/src/lwrb/lwrb.c
dev/VisualStudio/main.c
)

target_include_directories(${PROJECT_NAME} PRIVATE
dev/VisualStudio
lwrb/src/include
)

target_compile_definitions(${PROJECT_NAME} PRIVATE
WIN32
_DEBUG
CONSOLE
LWRB_DEV
)

set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)

0 comments on commit 50abc6f

Please sign in to comment.