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

[cmake] Add ninja support for Windows #15635

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion builtins/cfitsio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if(NOT WIN32)
set(CFITSIO_C_FLAGS -fPIC)
endif()

if(WIN32)
if(WIN32 AND NOT CMAKE_GENERATOR MATCHES Ninja)
if(winrtdebug)
set(CFITSIO_BUILD_COMMAND_FLAGS "--config Debug")
else()
Expand Down
16 changes: 11 additions & 5 deletions builtins/pcre/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@ foreach(var PCRE_FOUND PCRE_VERSION PCRE_INCLUDE_DIR PCRE_PCRE_LIBRARY PCRE_LIBR
endforeach()

if(WIN32)
if(winrtdebug)
set(PCRE_POSTFIX $<$<CONFIG:Debug>:d>)
set(pcre_config_kind "Debug")
if(CMAKE_GENERATOR MATCHES Ninja)
if (CMAKE_BUILD_TYPE MATCHES Debug)
Comment on lines +16 to +17
Copy link
Contributor

@guitargeek guitargeek Jun 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(CMAKE_GENERATOR MATCHES Ninja)
if (CMAKE_BUILD_TYPE MATCHES Debug)
if(CMAKE_GENERATOR MATCHES Ninja AND CMAKE_BUILD_TYPE MATCHES Debug)

Maybe better?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. the if() - else() test is for ninja only, independently of the build type

set(PCRE_POSTFIX d)
pcanal marked this conversation as resolved.
Show resolved Hide resolved
endif()
else()
set(pcre_config_kind "Release")
if(winrtdebug)
set(PCRE_POSTFIX $<$<CONFIG:Debug>:d>)
set(pcre_config_kind "Debug")
else()
set(pcre_config_kind "Release")
endif()
set(pcre_config "--config")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, is this not in the else() of the if(WIN32) branch? Why is winrtdebug relevant then? I thought if(WIN32) is true for any ROOT build on Windows

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code is correct, but I'll make it more clear

endif()
set(pcre_config "--config")
endif()

set(PCRE_VERSION "8.43" CACHE INTERNAL "" FORCE)
Expand Down
3 changes: 1 addition & 2 deletions cmake/modules/RootMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1846,8 +1846,7 @@ function(ROOT_ADD_GTEST test_suite)
endif(ARG_INCLUDE_DIRS)

if(MSVC)
set(test_exports "/EXPORT:_Init_thread_abort /EXPORT:_Init_thread_epoch
/EXPORT:_Init_thread_footer /EXPORT:_Init_thread_header /EXPORT:_tls_index")
set(test_exports "/EXPORT:_Init_thread_abort /EXPORT:_Init_thread_epoch /EXPORT:_Init_thread_footer /EXPORT:_Init_thread_header /EXPORT:_tls_index")
set_property(TARGET ${test_suite} APPEND_STRING PROPERTY LINK_FLAGS ${test_exports})
endif()

Expand Down
95 changes: 68 additions & 27 deletions cmake/modules/SearchInstalledSoftware.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -127,20 +127,29 @@ if(builtin_freetype)
message(STATUS "Building freetype version ${freetype_version} included in ROOT itself")
set(FREETYPE_LIBRARY ${CMAKE_BINARY_DIR}/FREETYPE-prefix/src/FREETYPE/objs/.libs/${CMAKE_STATIC_LIBRARY_PREFIX}freetype${CMAKE_STATIC_LIBRARY_SUFFIX})
if(WIN32)
set(freetypebuild "Release")
set(freetypelib freetype.lib)
if(winrtdebug)
set(freetypebuild "Debug")
set(freetypelib freetyped.lib)
if(CMAKE_GENERATOR MATCHES Ninja)
set(freetypelib freetype.lib)
if (CMAKE_BUILD_TYPE MATCHES "Debug")
set(freetypelib freetyped.lib)
endif()
else()
set(freetypebuild "Release")
set(freetypelib freetype.lib)
if(winrtdebug)
set(freetypebuild "Debug")
set(freetypelib freetyped.lib)
endif()
set(EXTRA_BUILD_ARGS --config ${freetypebuild})
set(LIB_DIR "${freetypebuild}/")
endif()
ExternalProject_Add(
FREETYPE
URL ${CMAKE_SOURCE_DIR}/graf2d/freetype/src/freetype-${freetype_version}.tar.gz
URL_HASH SHA256=efe71fd4b8246f1b0b1b9bfca13cfff1c9ad85930340c27df469733bbb620938
INSTALL_DIR ${CMAKE_BINARY_DIR}
CMAKE_ARGS -G ${CMAKE_GENERATOR} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DFT_DISABLE_BZIP2=TRUE
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config ${freetypebuild}
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ${freetypebuild}/${freetypelib} ${FREETYPE_LIBRARY}
CMAKE_ARGS -G ${CMAKE_GENERATOR} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DFT_DISABLE_BZIP2=TRUE
BUILD_COMMAND ${CMAKE_COMMAND} --build . ${EXTRA_BUILD_ARGS}
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ${LIB_DIR}${freetypelib} ${FREETYPE_LIBRARY}
LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 BUILD_IN_SOURCE 0
BUILD_BYPRODUCTS ${FREETYPE_LIBRARY}
TIMEOUT 600
Expand Down Expand Up @@ -240,6 +249,7 @@ if(builtin_lzma)
BUILD_COMMAND ""
INSTALL_COMMAND ""
LOG_DOWNLOAD 1
BUILD_BYPRODUCTS ${LIBLZMA_LIBRARIES}
TIMEOUT 600
)
set(LIBLZMA_INCLUDE_DIR ${CMAKE_BINARY_DIR}/LZMA/src/LZMA/include)
Expand Down Expand Up @@ -416,18 +426,22 @@ if(asimage)
#---AfterImage---------------------------------------------------------------
set(AFTERIMAGE_LIBRARIES ${CMAKE_BINARY_DIR}/lib/libAfterImage${CMAKE_STATIC_LIBRARY_SUFFIX})
if(WIN32)
if(winrtdebug)
set(astepbld "Debug")
else()
set(astepbld "Release")
if(NOT CMAKE_GENERATOR MATCHES Ninja)
if(winrtdebug)
set(astepbld "Debug")
else()
set(astepbld "Release")
endif()
set(EXTRA_BUILD_ARGS --config ${astepbld})
set(LIB_DIR "${astepbld}/")
endif()
ExternalProject_Add(
AFTERIMAGE
DOWNLOAD_COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/graf2d/asimage/src/libAfterImage AFTERIMAGE
INSTALL_DIR ${CMAKE_BINARY_DIR}
CMAKE_ARGS -G ${CMAKE_GENERATOR} -DCMAKE_VERBOSE_MAKEFILE=ON -DFREETYPE_INCLUDE_DIR=${FREETYPE_INCLUDE_DIR} -DZLIB_INCLUDE_DIR=${ZLIB_INCLUDE_DIR}
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config ${astepbld}
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ${astepbld}/libAfterImage.lib <INSTALL_DIR>/lib/
CMAKE_ARGS -G ${CMAKE_GENERATOR} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DFREETYPE_INCLUDE_DIR=${FREETYPE_INCLUDE_DIR} -DZLIB_INCLUDE_DIR=${ZLIB_INCLUDE_DIR}
BUILD_COMMAND ${CMAKE_COMMAND} --build . ${EXTRA_BUILD_ARGS}
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ${LIB_DIR}libAfterImage.lib <INSTALL_DIR>/lib/
LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 BUILD_IN_SOURCE 0
BUILD_BYPRODUCTS ${AFTERIMAGE_LIBRARIES}
TIMEOUT 600
Expand Down Expand Up @@ -517,6 +531,11 @@ if(mathmore OR builtin_gsl)
set(mathmore OFF CACHE BOOL "Disable because builtin_gsl disabled and external GSL not found (${mathmore_description})" FORCE)
endif()
endif()
if(WIN32 AND GSL_FOUND)
if(GSL_LIBRARY_DEBUG AND GSL_CBLAS_LIBRARY_DEBUG)
set(GSL_LIBRARIES optimized;${GSL_LIBRARY};optimized;${GSL_CBLAS_LIBRARY};debug;${GSL_LIBRARY_DEBUG};debug;${GSL_CBLAS_LIBRARY_DEBUG})
endif()
endif()
else()
set(gsl_version 2.5)
message(STATUS "Downloading and building GSL version ${gsl_version}")
Expand Down Expand Up @@ -1223,20 +1242,31 @@ if(builtin_tbb)
set(tbb_sha256 1ce48f34dada7837f510735ff1172f6e2c261b09460e3bf773b49791d247d24e)

if(MSVC)
set(tbb_build Release)
if(winrtdebug)
set(tbb_build Debug)
set(tbbsuffix "_debug")
if(CMAKE_GENERATOR MATCHES Ninja)
if (CMAKE_BUILD_TYPE MATCHES "Debug")
set(tbbsuffix "_debug")
endif()
else()
set(tbb_build Release)
if(winrtdebug)
set(tbb_build Debug)
set(tbbsuffix "_debug")
endif()
set(EXTRA_TBB_BUILD_ARGS --config ${tbb_build})
endif()
set(TBB_LIBRARIES ${CMAKE_BINARY_DIR}/lib/tbb12${tbbsuffix}.lib)
ExternalProject_Add(
TBB
URL ${tbb_url}
URL_HASH SHA256=${tbb_sha256}
INSTALL_DIR ${CMAKE_BINARY_DIR}
CMAKE_ARGS -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} -DTBB_ENABLE_IPO=OFF -DTBB_TEST=Off -DTBB_STRICT=Off -DTBBMALLOC_BUILD=Off -DTBBMALLOC_PROXY_BUILD=Off "-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}" "-DCMAKE_INSTALL_LIBDIR=${CMAKE_BINARY_DIR}/lib" "-DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_BINARY_DIR}/include"
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config ${tbb_build}
INSTALL_COMMAND ${CMAKE_COMMAND} --install . --config ${tbb_build}
CMAKE_ARGS -G ${CMAKE_GENERATOR} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DTBB_ENABLE_IPO=OFF
-DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG}
-DTBB_TEST=Off -DTBB_STRICT=Off -DTBBMALLOC_BUILD=Off -DTBBMALLOC_PROXY_BUILD=Off
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}
-DCMAKE_INSTALL_LIBDIR=${CMAKE_BINARY_DIR}/lib
-DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_BINARY_DIR}/include
BUILD_COMMAND ${CMAKE_COMMAND} --build . ${EXTRA_TBB_BUILD_ARGS}
LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 LOG_OUTPUT_ON_FAILURE 1
BUILD_BYPRODUCTS ${TBB_LIBRARIES}
TIMEOUT 600
Expand Down Expand Up @@ -1815,17 +1845,27 @@ if (builtin_gtest)
)

if(MSVC)
set(gtestbuild "Release")
if(winrtdebug)
set(gtestbuild "Debug")
set(GTEST_BUILD_TYPE ${CMAKE_BUILD_TYPE})
set(_gtest_byproducts
${_gtest_byproduct_binary_dir}/lib/gtest.lib
${_gtest_byproduct_binary_dir}/lib/gtest_main.lib
${_gtest_byproduct_binary_dir}/lib/gmock.lib
${_gtest_byproduct_binary_dir}/lib/gmock_main.lib
)
if(CMAKE_GENERATOR MATCHES Ninja)
set(GTEST_BUILD_COMMAND "BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR>")
else()
set(GTEST_BUILD_COMMAND "BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config Release")
endif()
set(EXTRA_GTEST_OPTS
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG:PATH=${_gtest_byproduct_binary_dir}/lib/
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_MINSIZEREL:PATH=${_gtest_byproduct_binary_dir}/lib/
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE:PATH=${_gtest_byproduct_binary_dir}/lib/
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO:PATH=${_gtest_byproduct_binary_dir}/lib/
-Dgtest_force_shared_crt=ON
BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config ${gtestbuild})
${GTEST_BUILD_COMMAND})
else()
set(GTEST_BUILD_TYPE Release)
endif()
if(APPLE)
set(EXTRA_GTEST_OPTS
Expand All @@ -1844,11 +1884,12 @@ if (builtin_gtest)
# -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE:PATH=ReleaseLibs
# -Dgtest_force_shared_crt=ON
CMAKE_ARGS -G ${CMAKE_GENERATOR}
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_BUILD_TYPE=${GTEST_BUILD_TYPE}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_CXX_FLAGS=${ROOT_EXTERNAL_CXX_FLAGS}
-DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG}
-DCMAKE_AR=${CMAKE_AR}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
${EXTRA_GTEST_OPTS}
Expand Down
35 changes: 24 additions & 11 deletions cmake/modules/SetUpWindows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@ elseif(MSVC)
math(EXPR VC_MAJOR "${MSVC_VERSION} / 100")
math(EXPR VC_MINOR "${MSVC_VERSION} % 100")

if(winrtdebug)
set(BLDCXXFLAGS "-Zc:__cplusplus -std:c++${CMAKE_CXX_STANDARD} -MDd -GR")
set(BLDCFLAGS "-MDd")
if(CMAKE_GENERATOR MATCHES Ninja)
set(BLDCXXFLAGS "-Zc:__cplusplus -std:c++${CMAKE_CXX_STANDARD} -GR")
else()
set(BLDCXXFLAGS "-Zc:__cplusplus -std:c++${CMAKE_CXX_STANDARD} -MD -GR")
set(BLDCFLAGS "-MD")
if(winrtdebug)
set(BLDCXXFLAGS "-Zc:__cplusplus -std:c++${CMAKE_CXX_STANDARD} -MDd -GR")
set(BLDCFLAGS "-MDd")
else()
set(BLDCXXFLAGS "-Zc:__cplusplus -std:c++${CMAKE_CXX_STANDARD} -MD -GR")
set(BLDCFLAGS "-MD")
endif()
endif()

if(CMAKE_PROJECT_NAME STREQUAL ROOT)
Expand All @@ -54,12 +58,21 @@ elseif(MSVC)
endif()

#---Select compiler flags----------------------------------------------------------------
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -Ob2 -Z7")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -Ob2 -DNDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "-Od -Ob0 -Z7")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -Ob2 -Z7")
set(CMAKE_C_FLAGS_RELEASE "-O2 -Ob2 -DNDEBUG")
set(CMAKE_C_FLAGS_DEBUG "-Od -Ob0 -Z7")
if(CMAKE_GENERATOR MATCHES Ninja)
if (CMAKE_BUILD_TYPE MATCHES Debug AND CMAKE_SIZEOF_VOID_P EQUAL 8)
string(REGEX MATCH "-D_ITERATOR_DEBUG_LEVEL=0" result ${CMAKE_CXX_FLAGS_DEBUG})
if(NOT result MATCHES "-D_ITERATOR_DEBUG_LEVEL=0")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_ITERATOR_DEBUG_LEVEL=0")
endif()
endif()
else()
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -Ob2 -Z7")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -Ob2 -DNDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "-Od -Ob0 -Z7")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -Ob2 -Z7")
set(CMAKE_C_FLAGS_RELEASE "-O2 -Ob2 -DNDEBUG")
set(CMAKE_C_FLAGS_DEBUG "-Od -Ob0 -Z7")
endif()

#---Set Linker flags----------------------------------------------------------------------
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -ignore:4049,4206,4217,4221 -incremental:no")
Expand Down
19 changes: 17 additions & 2 deletions core/base/src/TSystem.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2872,6 +2872,12 @@ int TSystem::CompileMacro(const char *filename, Option_t *opt,
mode = kDebug;
}
}
#if defined(_MSC_VER) && !defined(NDEBUG)
// 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 @@ -3713,14 +3719,23 @@ int TSystem::CompileMacro(const char *filename, Option_t *opt,
cmd.ReplaceAll("$BuildDir","\"$BuildDir\"");
cmd.ReplaceAll("$BuildDir",build_loc);
TString optdebFlags;
#ifdef WIN32
if (mode & kDebug)
optdebFlags = fFlagsDebug + " ";
if (mode & kOpt)
else 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 ");
}
#else
if (mode & kDebug)
optdebFlags = fFlagsDebug + " ";
if (mode & kOpt)
guitargeek marked this conversation as resolved.
Show resolved Hide resolved
optdebFlags += fFlagsOpt;
cmd.ReplaceAll("$Opt", optdebFlags);
#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 @@ -2136,6 +2136,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"); //, (long)_ITERATOR_DEBUG_LEVEL);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that fix: "the I/O is still broken in debug mode, due to the special iterators on x64," ?

Copy link
Member Author

@bellenot bellenot May 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately not, it's just a workaround. The problem is that one can only link the ROOT libraries in debug mode if they use the same flag with their software. Even worse, the externals have to be built with the same flag (e.g. I had the issue with Pythia8)!
And you are the only one able to fix the issue!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

clingArgs.push_back(platformDefines);
#endif
#endif
}

Expand Down
8 changes: 6 additions & 2 deletions core/metacling/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,12 @@ if(MSVC)
??1LifetimeHandler@internal@runtime@cling@@QEAA@XZ
?_Facet_Register@std@@YAXPEAV_Facet_base@1@@Z
)
if($<CONFIG:Debug>)
set(cling_exports ${cling_exports} ??$dyn_cast@VValueDecl@clang@@$$CBVDecl@2@@llvm@@YAPEBVValueDecl@clang@@PEBVDecl@2@@Z)
if(CMAKE_GENERATOR MATCHES Ninja AND CMAKE_BUILD_TYPE MATCHES Debug)
set(cling_exports ${cling_exports} ??$dyn_cast@VValueDecl@clang@@$$CBVDecl@2@@llvm@@YAPEBVValueDecl@clang@@PEBVDecl@2@@Z)
else()
if($<CONFIG:Debug>)
set(cling_exports ${cling_exports} ??$dyn_cast@VValueDecl@clang@@$$CBVDecl@2@@llvm@@YAPEBVValueDecl@clang@@PEBVDecl@2@@Z)
endif()
endif()
else()
set(cling_exports ${cling_exports}
Expand Down
4 changes: 3 additions & 1 deletion core/rootcling_stage1/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,7 @@ if (CMAKE_SYSTEM_NAME MATCHES FreeBSD)
target_link_libraries(rootcling_stage1 util procstat)
endif()

set_target_properties(rootcling_stage1 PROPERTIES RUNTIME_OUTPUT_DIRECTORY src)
if(NOT (WIN32 AND CMAKE_GENERATOR MATCHES Ninja))
set_target_properties(rootcling_stage1 PROPERTIES RUNTIME_OUTPUT_DIRECTORY src)
endif()
add_dependencies(rootcling_stage1 ClingUtils)
13 changes: 10 additions & 3 deletions graf2d/win32gdk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,17 @@ file(GLOB iconvfiles "gdk/src/iconv/*.*")
file(GLOB_RECURSE glibfiles "gdk/src/glib/*.*")
file(GLOB_RECURSE gdkfiles "gdk/src/gdk/*.*")

if(winrtdebug)
set(nmcxxflags "${CMAKE_CXX_FLAGS_DEBUG}" DEBUG=1)
if(CMAKE_GENERATOR MATCHES Ninja)
set(nmcxxflags ${CMAKE_CXX_FLAGS_${_BUILD_TYPE_UPPER}})
if (CMAKE_BUILD_TYPE MATCHES "Debug")
set(nmcxxflags "${nmcxxflags}" DEBUG=1)
endif()
else()
set(nmcxxflags "${CMAKE_CXX_FLAGS_RELEASE}")
if(winrtdebug)
set(nmcxxflags "${CMAKE_CXX_FLAGS_DEBUG}" DEBUG=1)
else()
set(nmcxxflags "${CMAKE_CXX_FLAGS_RELEASE}")
endif()
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(nmcxxflags "${nmcxxflags} -D_WIN64")
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
Loading
Loading