Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional debug configuration for a better debugging experience + CI update #1893

Merged
merged 12 commits into from
Jan 30, 2025
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<PropertyGroup>
<RootDir>$(MSBuildThisFileDirectory)</RootDir>
<Platforms>x86;x64</Platforms>
<Configurations>Debug;DebugOpt;Release</Configurations>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
8 changes: 7 additions & 1 deletion build/Helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ newoption {
allowed = {
{ "Release", "Release" },
{ "Debug", "Debug" },
{ "DebugOpt", "DebugOpt" },
}
}

Expand Down Expand Up @@ -104,10 +105,15 @@ function SetupNativeProject()

filter { "configurations:Debug" }
defines { "DEBUG" }

filter { "configurations:DebugOpt" }
defines { "DEBUG", "_ITERATOR_DEBUG_LEVEL=0" }
duckdoom5 marked this conversation as resolved.
Show resolved Hide resolved
optimize "Debug"
runtime "Release"

filter { "configurations:Release" }
defines { "NDEBUG" }
optimize "On"
optimize "Full"

-- Compiler-specific options

Expand Down
18 changes: 18 additions & 0 deletions build/LLVM.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ function SetupLLVMIncludes()
local c = filter()

if LLVMDirPerConfiguration then
filter { "configurations:DebugOpt" }
includedirs
{
path.join(LLVMRootDirRelease, "include"),
path.join(LLVMRootDirRelease, "llvm/include"),
path.join(LLVMRootDirRelease, "lld/include"),
path.join(LLVMRootDirRelease, "clang/include"),
path.join(LLVMRootDirRelease, "clang/lib"),
path.join(LLVMRootDirRelease, "build/include"),
path.join(LLVMRootDirRelease, "build/clang/include"),
}

filter { "configurations:Debug" }
includedirs
{
Expand Down Expand Up @@ -121,6 +133,9 @@ function SetupLLVMLibs()
filter {}

if LLVMDirPerConfiguration then
filter { "configurations:DebugOpt" }
libdirs { path.join(LLVMRootDirRelease, "build/lib") }

filter { "configurations:Debug" }
libdirs { path.join(LLVMRootDirDebug, "build/lib") }

Expand All @@ -129,6 +144,9 @@ function SetupLLVMLibs()
else
local LLVMBuildDir = get_llvm_build_dir()
libdirs { path.join(LLVMBuildDir, "lib") }

filter { "configurations:DebugOpt", "toolset:msc*" }
libdirs { path.join(LLVMBuildDir, "RelWithDebInfo/lib") }

filter { "configurations:Debug", "toolset:msc*" }
libdirs { path.join(LLVMBuildDir, "Debug/lib") }
Expand Down
2 changes: 1 addition & 1 deletion build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e
builddir=$(cd "$(dirname "$0")"; pwd)
platform=x64
vs=vs2022
configuration=Release
configuration=DebugOpt
build_only=false
ci=false
target_framework=
Expand Down
3 changes: 3 additions & 0 deletions build/llvm/LLVM.lua
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ function get_llvm_package_name(rev, conf, arch)
end

function get_llvm_configuration_name(debug)
if string.find(_OPTIONS["configuration"], "DebugOpt") then
return os.istarget("windows") and "RelWithDebInfo" or "Release"
end
if string.find(_OPTIONS["configuration"], "Debug") then
return "Debug"
end
Expand Down
8 changes: 8 additions & 0 deletions tests/dotnet/CLI/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"profiles": {
"CLI.Gen": {
"commandName": "Project",
"nativeDebugging": true
}
}
}
8 changes: 8 additions & 0 deletions tests/dotnet/CSharp/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"profiles": {
"CSharp.Gen": {
"commandName": "Project",
"nativeDebugging": true
}
}
}
8 changes: 8 additions & 0 deletions tests/dotnet/Common/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"profiles": {
"Common.Gen": {
"commandName": "Project",
"nativeDebugging": true
}
}
}
8 changes: 8 additions & 0 deletions tests/dotnet/Encodings/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"profiles": {
"Encodings.Gen": {
"commandName": "Project",
"nativeDebugging": true
}
}
}
8 changes: 8 additions & 0 deletions tests/dotnet/NamespacesDerived/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"profiles": {
"NamespacesDerived.Gen": {
"commandName": "Project",
"nativeDebugging": true
}
}
}
8 changes: 8 additions & 0 deletions tests/dotnet/StandardLib/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"profiles": {
"StandardLib.Gen": {
"commandName": "Project",
"nativeDebugging": true
}
}
}
8 changes: 8 additions & 0 deletions tests/dotnet/VTables/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"profiles": {
"VTables.Gen": {
"commandName": "Project",
"nativeDebugging": true
}
}
}
Loading