Unable to build with correct debug level
Hi all,
I'm creating static debug builds of all the libraries I'm using (MTd) with LLVM clang, and have it working for all libraries so far except Rive. I've been trying different things for a couple of days. Any help appreciated!
This is my linker output:
1>lld-link : error : /failifmismatch: mismatch detected for '_ITERATOR_DEBUG_LEVEL':
1>>>> skia.lib(skia.SkColorSpace.obj) has value 2
1>>>> rive.lib(binary_reader.o) has value 0
This is my current (part of) premake lua:
filter "configurations:debug"
buildoptions {"-MTd"}
debuglevel (2)
symbols "On"
This is an example of the generated command:
clang++ -MMD -MP -D_USE_MATH_DEFINES -I../include -m64 -g -std=c++17 -Wall -fno-exceptions -fno-rtti -MTd -o \"obj/debug/artboard.o\" -MF \"obj/debug/artboard.d\" -c \"../src/artboard.cpp\""
Note that I don't think debuglevel (2) has done anything (the command has the same arguments if I leave it off).
Note that all my libraries are built with debug level of 2, but whatever I do I cannot get Rive to build with this level.
Any help appreciated!
For anyone with this issue in the future. If you are compiling on windows and require a debug build with an iterator debug level of 2, this is how I solved it:
- Modify premake5.lua to specifically use clang and to add some extra flags in the debug config
- Use bash to run
build.sh, but use PowerShell to run the finalmakecommand
Here is my premake5.lua
workspace "rive"
configurations {"debug", "release"}
project "rive"
kind "StaticLib"
language "C++"
cppdialect "C++17"
toolset "clang"
system "windows"
architecture "x86_64"
targetdir "bin/%{cfg.buildcfg}"
objdir "obj/%{cfg.buildcfg}"
includedirs {"../include"}
files {"../src/**.cpp"}
buildoptions {"-Wall", "-fno-exceptions", "-fno-rtti"}
filter "system:windows"
defines {"_USE_MATH_DEFINES"}
filter "configurations:debug"
buildoptions {"-MTd"}
symbols "On"
defines {"DEBUG"}
defines {"_DEBUG"}
defines {"_ITERATOR_DEBUG_LEVEL=2"}
filter "configurations:release"
defines {"RELEASE"}
defines {"NDEBUG"}
optimize "On"
-- Clean Function --
newaction {
trigger = "clean",
description = "clean the build",
execute = function()
print("clean the build...")
os.rmdir("./bin")
os.rmdir("./obj")
os.remove("Makefile")
-- no wildcards in os.remove, so use shell
os.execute("rm *.make")
print("build cleaned")
end
}