Skip to content

Commit 50abc6f

Browse files
committed
Add vscode and CMake support
1 parent e0c0bad commit 50abc6f

File tree

5 files changed

+157
-0
lines changed

5 files changed

+157
-0
lines changed

.gitignore

+16
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,13 @@
2222
*.uvoptx
2323
*.__i
2424
*.i
25+
*.txt
2526
!docs/*.txt
27+
!CMakeLists.txt
2628
RTE/
2729

30+
*debug
31+
2832
# IAR Settings
2933
**/settings/*.crun
3034
**/settings/*.dbgdt
@@ -68,13 +72,15 @@ RTE/
6872
[Dd]ebugPublic/
6973
[Rr]elease/
7074
[Rr]eleases/
75+
[Dd]ebug*/
7176
x64/
7277
x86/
7378
bld/
7479
[Bb]in/
7580
[Oo]bj/
7681
[Ll]og/
7782
_build/
83+
build/
7884

7985
# Visual Studio 2015/2017 cache/options directory
8086
.vs/
@@ -382,3 +388,13 @@ log_file.txt
382388
project.ioc
383389
mx.scratch
384390
*.tilen majerle
391+
392+
393+
# Altium
394+
Project outputs*
395+
History/
396+
*.SchDocPreview
397+
*.$$$Preview
398+
399+
# VSCode projects
400+
project_vscode_compiled.exe

.vscode/c_cpp_properties.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"version": 4,
3+
"configurations": [
4+
{
5+
"name": "Win32",
6+
"includePath": [
7+
"${workspaceFolder}\\dev\\VisualStudio\\",
8+
"${workspaceFolder}\\lwrb\\src\\include\\",
9+
"${workspaceFolder}\\"
10+
],
11+
"defines": [
12+
"WIN32",
13+
"_DEBUG",
14+
"UNICODE",
15+
"_UNICODE",
16+
"LWESP_DEV"
17+
],
18+
"compilerPath": "c:\\msys64\\mingw64\\bin\\gcc.exe",
19+
"cStandard": "gnu17",
20+
"cppStandard": "gnu++14",
21+
"intelliSenseMode": "windows-gcc-x86",
22+
"configurationProvider": "ms-vscode.cmake-tools"
23+
}
24+
]
25+
}

.vscode/launch.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "(Windows) Launch",
9+
"type": "cppvsdbg",
10+
"request": "launch",
11+
"program": "${workspaceFolder}\\build\\LwLibPROJECT.exe",
12+
"miDebuggerPath": "c:\\msys64\\mingw64\\bin\\gdb.exe",
13+
"args": [],
14+
"stopAtEntry": false,
15+
"cwd": "${fileDirname}",
16+
"environment": [],
17+
"console": "integratedTerminal"
18+
}
19+
]
20+
}

.vscode/tasks.json

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"version": "2.0.0",
3+
4+
/* For this builds, you need
5+
*
6+
* - Ninja build system
7+
* - MSYS2 compiler with ninja support
8+
* - C/C++ extension for VSCode
9+
* - CMake-Tools extension for VSCode
10+
*/
11+
"tasks": [
12+
{
13+
"type": "cppbuild",
14+
"label": "Build project",
15+
"command": "cmake",
16+
"args": [
17+
"--build",
18+
"\"build\""
19+
],
20+
"options": {
21+
"cwd": "${workspaceFolder}"
22+
},
23+
"problemMatcher": [
24+
"$gcc"
25+
],
26+
"group": {
27+
"kind": "build",
28+
"isDefault": true
29+
}
30+
},
31+
{
32+
"type": "shell",
33+
"label": "Rebuild project",
34+
"command": "cmake",
35+
"args": [
36+
"--build",
37+
"\"build\"",
38+
"--clean-first"
39+
],
40+
"options": {
41+
"cwd": "${workspaceFolder}"
42+
},
43+
"problemMatcher": [
44+
"$gcc"
45+
],
46+
},
47+
{
48+
"type": "shell",
49+
"label": "Clean project",
50+
"command": "cmake",
51+
"args": [
52+
"--build",
53+
"\"build\"",
54+
"--target",
55+
"clean"
56+
],
57+
"options": {
58+
"cwd": "${workspaceFolder}"
59+
},
60+
"problemMatcher": []
61+
},
62+
{
63+
"type": "shell",
64+
"label": "Run application",
65+
"command": "${workspaceFolder}\\build\\LwLibPROJECT.exe",
66+
"args": [],
67+
"problemMatcher": [],
68+
},
69+
]
70+
}

CMakeLists.txt

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
cmake_minimum_required(VERSION 3.0.0)
2+
project(LwLibPROJECT VERSION 0.1.0)
3+
4+
include(CTest)
5+
enable_testing()
6+
7+
add_executable(${PROJECT_NAME}
8+
lwrb/src/lwrb/lwrb.c
9+
dev/VisualStudio/main.c
10+
)
11+
12+
target_include_directories(${PROJECT_NAME} PRIVATE
13+
dev/VisualStudio
14+
lwrb/src/include
15+
)
16+
17+
target_compile_definitions(${PROJECT_NAME} PRIVATE
18+
WIN32
19+
_DEBUG
20+
CONSOLE
21+
LWRB_DEV
22+
)
23+
24+
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
25+
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
26+
include(CPack)

0 commit comments

Comments
 (0)