Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions cmake/modules/SetUpWindows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,17 @@ elseif(MSVC)
math(EXPR VC_MINOR "${MSVC_VERSION} % 100")

#---Select compiler flags----------------------------------------------------------------
if(winrtdebug AND dev)
set(ROOT_RTC_FLAGS "-RTC1")
endif()
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-MD -O2 -Ob2 -Z7 -DNDEBUG")
set(CMAKE_CXX_FLAGS_MINSIZEREL "-MD -O1 -Ob1 -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-MD -O2 -Ob2 -DNDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "-MDd -Od -Ob0 -Z7")
set(CMAKE_CXX_FLAGS_DEBUG "-MDd -Od -Ob0 -Z7 ${ROOT_RTC_FLAGS}")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-MD -O2 -Ob2 -Z7 -DNDEBUG")
set(CMAKE_C_FLAGS_MINSIZEREL "-MD -O1 -Ob1 -DNDEBUG")
set(CMAKE_C_FLAGS_RELEASE "-MD -O2 -Ob2 -DNDEBUG")
set(CMAKE_C_FLAGS_DEBUG "-MDd -Od -Ob0 -Z7")
set(CMAKE_C_FLAGS_DEBUG "-MDd -Od -Ob0 -Z7 ${ROOT_RTC_FLAGS}")

if(winrtdebug)
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
Expand Down
4 changes: 2 additions & 2 deletions cmake/scripts/compiledata.win32.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#define COMPILERVERSSTR "@CMAKE_CXX_COMPILER_ID@ @CMAKE_CXX_COMPILER_VERSION@"
#define MAKESHAREDLIB "cl $Opt -nologo -TP -c @CMAKE_CXX_FLAGS@ @BLDCXXFLAGS@ $IncludePath $SourceFiles -Fo$ObjectFiles && bindexplib $LibName $ObjectFiles > $BuildDir\\$LibName.def && lib -nologo -MACHINE:@MACHINE_ARCH@ -out:$BuildDir\\$LibName.lib $ObjectFiles -def:$BuildDir\\$LibName.def && link -nologo $ObjectFiles -DLL -out:$BuildDir\\$LibName.dll $BuildDir\\$LibName.exp -LIBPATH:%ROOTSYS%\\lib $LinkedLibs libCore.lib kernel32.lib advapi32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib && if EXIST \"$BuildDir\\$LibName.dll.manifest\" ( mt -nologo -manifest \"$BuildDir\\$LibName.dll.manifest\" \"-outputresource:$BuildDir\\$LibName.dll;2\" && del \"$BuildDir\\$LibName.dll.manifest\" )"
#define MAKEEXE "cl -nologo -TP -Iinclude -I..\\include -c $Opt @CMAKE_CXX_FLAGS@ @BLDCXXFLAGS@ $IncludePath $SourceFiles && link -opt:ref @CMAKE_EXE_FLAGS@ $ObjectFiles $LinkedLibs advapi32.lib -out:$ExeName && if EXIST \"$ExeName.exe.manifest\" ( mt -nologo -manifest \"$ExeName.exe.manifest\" \"-outputresource:$ExeName.exe;1\" && del \"$ExeName.exe.manifest\" )"
#define CXXOPT "@CMAKE_CXX_FLAGS_RELEASE@"
#define CXXDEBUG "@CMAKE_CXX_FLAGS_DEBUG@"
#define CXXOPT "@CMAKE_CXX_FLAGS_RELEASE@ @BLDCXXFLAGS@"
#define CXXDEBUG "@CMAKE_CXX_FLAGS_DEBUG@ @BLDCXXFLAGS@"
#define ROOTBUILD "release"
#define LINKEDLIBS "-LIBPATH:%ROOTSYS%\\lib libCore.lib "
#define INCLUDEPATH "-I%ROOTSYS%\\include"
Expand Down
12 changes: 12 additions & 0 deletions core/base/src/TSystem.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2885,6 +2885,12 @@ int TSystem::CompileMacro(const char *filename, Option_t *opt,
mode = kDebug;
}
}
#if defined(_MSC_VER) && defined(_DEBUG)
// if ROOT is build in debug mode, ACLiC must also build in debug mode
// for compatibility reasons
if (!(mode & kDebug))
mode |= kDebug;
#endif
UInt_t verboseLevel = verbose ? 7 : gDebug;
Bool_t flatBuildDir = (fAclicProperties & kFlatBuildDir) || (opt && strchr(opt,'-')!=nullptr);

Expand Down Expand Up @@ -3729,12 +3735,18 @@ int TSystem::CompileMacro(const char *filename, Option_t *opt,
TString optdebFlags;
if (mode & kDebug)
optdebFlags = fFlagsDebug + " ";
#ifdef WIN32
else
#endif
if (mode & kOpt)
optdebFlags += fFlagsOpt;
cmd.ReplaceAll("$Opt", optdebFlags);
#ifdef WIN32
R__FixLink(cmd);
cmd.ReplaceAll("-std=", "-std:");
if (mode & kDebug) {
cmd.ReplaceAll(" && link ", "&& link /DEBUG ");
}
#endif

TString testcmd = fMakeExe;
Expand Down
4 changes: 4 additions & 0 deletions core/dictgen/src/rootcling_impl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2135,6 +2135,10 @@ void AddPlatformDefines(std::vector<std::string> &clingArgs)
clingArgs.push_back(platformDefines);
snprintf(platformDefines, 64, "-DG__VISUAL=%ld", (long)_MSC_VER);
clingArgs.push_back(platformDefines);
#if defined(_WIN64) && defined(_DEBUG)
snprintf(platformDefines, 64, "-D_ITERATOR_DEBUG_LEVEL=0");
clingArgs.push_back(platformDefines);
#endif
#endif
}

Expand Down
3 changes: 2 additions & 1 deletion graf2d/win32gdk/gdk/src/glib/gmessages.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,8 @@ g_logv (const gchar *log_domain,
#endif
# if defined (_MSC_VER) && defined (_DEBUG)
/* let's see the call stack ... */
__asm int 3
/* __asm int 3 */
__debugbreak();
# endif
abort ();
#endif /* !G_ENABLE_DEBUG || !SIGTRAP */
Expand Down
4 changes: 4 additions & 0 deletions interpreter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,12 @@ if(builtin_llvm)
if(CMAKE_BUILD_TYPE MATCHES "Debug"
OR LLVM_BUILD_TYPE MATCHES "(Debug|RelWithDebInfo)")
set(LLVM_ENABLE_ASSERTIONS TRUE)
if(NOT DEFINED LLVM_ENABLE_DUMP)
set(LLVM_ENABLE_DUMP TRUE)
endif()
else()
set(LLVM_ENABLE_ASSERTIONS FALSE)
set(LLVM_ENABLE_DUMP FALSE)
Comment thread
bellenot marked this conversation as resolved.
endif()
endif()

Expand Down
3 changes: 3 additions & 0 deletions interpreter/cling/lib/Interpreter/CIFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,9 @@ namespace {
PPOpts.addMacroDef("__CLING__GNUC_MINOR__=" ClingStringify(__GNUC_MINOR__));
#elif defined(_MSC_VER)
PPOpts.addMacroDef("__CLING__MSVC__=" ClingStringify(_MSC_VER));
#if defined(_WIN64) && defined(_DEBUG)
PPOpts.addMacroDef("_ITERATOR_DEBUG_LEVEL=0");
#endif
#endif

// https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html
Expand Down
5 changes: 5 additions & 0 deletions io/io/src/TFile.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3222,6 +3222,11 @@ void TFile::MakeProject(const char *dirname, const char * /*classes*/,
} else {
sOpt = gSystem->GetFlagsDebug();
}
#if defined(_MSC_VER) && defined(_DEBUG)
// if ROOT is build in debug mode, ACLiC must also build in debug mode
// for compatibility reasons
sOpt = gSystem->GetFlagsDebug();
#endif
cmd.ReplaceAll("$Opt", sOpt);

if (genreflex) {
Expand Down
Loading