Update meson configuration files for vscode

This commit is contained in:
daleclack 2021-10-16 20:53:12 +08:00
parent 78d3cb4fd3
commit 0200924be5
8 changed files with 146 additions and 4 deletions

View File

@ -0,0 +1,35 @@
#A Simple Project Test
project('gtk113', 'cpp',
default_options : ['c_std=c17', 'cpp_std=c++17'])
#Initalize variants
gnome=import('gnome')
#Compile Resource
# gresources = gnome.compile_resources(
# 'resources', 'res/gtk112.gresource.xml',
# source_dir: 'res',
# c_name: 'resources'
# )
#compile schemas
# app_schemas = gnome.compile_schemas(depend_files: 'org.gtk.daleclack.gschema.xml')
#The Gtkmm Library as a dependency
gtkdep = dependency('gtkmm-3.0')
#Additional include dirs
dir_include = include_directories('..')
#source files
src = ['src/main.cc', 'src/FileWindow.cc']
#Use Different Build Opinions in windows and Linux
if host_machine.system() == 'windows'
win=import('windows')
icon_res=win.compile_resources('../icon.rc')
executable('gtk113', icon_res, src, dependencies : gtkdep,
win_subsystem : 'windows', include_directories : dir_include)
else
executable('gtk113', src, dependencies : gtkdep, include_directories : dir_include)
endif

View File

@ -0,0 +1,3 @@
#include "FileWindow.hh"
FileWindow::FileWindow(){}

View File

@ -0,0 +1,8 @@
#pragma once
#include <gtkmm.h>
class FileWindow : public Gtk::Window{
public:
FileWindow();
};

View File

@ -0,0 +1,7 @@
#include "FileWindow.hh"
int main(int argc,char **argv){
auto app = Gtk::Application::create(argc,argv,"org.gtk.daleclack");
FileWindow window;
return app->run(window);
}

View File

@ -0,0 +1,49 @@
//The configurations are for vscode with meson extension
//See configurations in "compileCommands"
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${default}",
"${workspaceFolder}/**",
"${workspaceFolder}/src/**"
],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "linux-gcc-x64",
"compileCommands": "${workspaceFolder}/builddir/compile_commands.json"
},
{
"name": "win32",
"includePath": [
"${default}",
"${workspaceFolder}/**",
"${workspaceFolder}/src/**"
],
"defines": [],
"compilerPath": "D:/msys64/MinGW64/bin/gcc.exe",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "windows-gcc-x64",
"compileCommands": "${workspaceFolder}/builddir_win32/compile_commands.json"
},
{
"name": "Mac",
"includePath": [
"${default}",
"${workspaceFolder}/**",
"${workspaceFolder}/src/**"
],
"defines": [],
"macFrameworkPath": [],
"compilerPath": "/usr/bin/clang",
"cStandard": "gnu17",
"cppStandard": "gnu++17",
"intelliSenseMode": "macos-clang-x64",
"compileCommands": "${workspaceFolder}/builddir/compile_commands.json"
}
],
"version": 4
}

View File

@ -8,7 +8,7 @@
"name": "(gdb) 启动",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/builddir/gtk91",
"program": "${workspaceFolder}/builddir/gtk108",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
@ -23,6 +23,41 @@
"ignoreFailures": true
}
]
},
{
"name": "(gdb) 启动win32)",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/builddir_win32/gtk108",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"preLaunchTask": "Meson: Build target",
"MIMode": "gdb",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"miDebuggerPath": "D:/msys64/mingw64/bin/gdb.exe"
},
{
"name": "(lldb) 启动",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/builddir/gtk108",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"preLaunchTask": "Meson: Build target",
"MIMode": "lldb",
"setupCommands": []
}
]
}

View File

@ -0,0 +1,5 @@
{
"C_Cpp.errorSquiggles": "Disabled",
"cmake.configureOnOpen": false,
"C_Cpp.dimInactiveRegions": false
}

View File

@ -2,7 +2,7 @@
"tasks": [
{
"type": "meson",
"target": "gtk91",
//"target": "gtk91",
"mode": "build",
"group": "build",
"problemMatcher": [],