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
88 changes: 62 additions & 26 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 @@ -1223,20 +1237,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 +1840,28 @@ if (builtin_gtest)
)

if(MSVC)
set(gtestbuild "Release")
if(winrtdebug)
set(gtestbuild "Debug")
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(gtestbuild Release)
if (CMAKE_BUILD_TYPE MATCHES "Debug")
set(gtestbuild Debug)
endif()
set(GTEST_BUILD_COMMAND "BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config ${gtestbuild}")
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})
endif()
if(APPLE)
set(EXTRA_GTEST_OPTS
Expand Down
14 changes: 8 additions & 6 deletions cmake/modules/SetUpWindows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,14 @@ 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(NOT CMAKE_GENERATOR MATCHES Ninja)
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
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
6 changes: 5 additions & 1 deletion interpreter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,13 @@ if(builtin_llvm)
get_directory_property(LLVM_TARGETS_TO_BUILD DIRECTORY llvm-project/llvm DEFINITION LLVM_TARGETS_TO_BUILD)

if(MSVC)
if(CMAKE_GENERATOR MATCHES Ninja)
set(LLVM_TABLEGEN_EXE "${LLVM_BINARY_DIR}/bin/llvm-tblgen.exe")
else()
set(LLVM_TABLEGEN_EXE "${LLVM_BINARY_DIR}/$<CONFIG>/bin/llvm-tblgen.exe")
endif()
else()
set(LLVM_TABLEGEN_EXE "${LLVM_BINARY_DIR}/bin/llvm-tblgen")
set(LLVM_TABLEGEN_EXE "${LLVM_BINARY_DIR}/bin/llvm-tblgen")
endif()
else()
# Rely on llvm-config.
Expand Down
24 changes: 16 additions & 8 deletions interpreter/cling/tools/plugins/clad/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,29 @@ set(clad_install_dir ${CMAKE_BINARY_DIR}/etc/cling/)
set(CLAD_INCLUDE_DIRS ${clad_install_dir})
# Clad Libraries
set(_clad_build_type ${CMAKE_CFG_INTDIR})
if(MSVC)
if(MSVC AND NOT CMAKE_GENERATOR MATCHES Ninja)
if (winrtdebug)
set(_clad_build_type Debug)
else()
set(_clad_build_type Release)
endif()
set(EXTRA_BUILD_ARGS --config ${_clad_build_type})
endif(MSVC)
set(_CLAD_LIBRARY_PATH ${CMAKE_CURRENT_BINARY_DIR}/clad-prefix/src/clad-build/${_clad_build_type}/lib${LLVM_LIBDIR_SUFFIX})

# build byproducts only needed by Ninja
if("${CMAKE_GENERATOR}" STREQUAL "Ninja")
set(CLAD_BYPRODUCTS
${_CLAD_LIBRARY_PATH}/${CMAKE_STATIC_LIBRARY_PREFIX}cladPlugin${CMAKE_STATIC_LIBRARY_SUFFIX}
${_CLAD_LIBRARY_PATH}/${CMAKE_STATIC_LIBRARY_PREFIX}cladDifferentiator${CMAKE_STATIC_LIBRARY_SUFFIX}
)
if(CMAKE_GENERATOR MATCHES Ninja)
if(MSVC)
set(CLAD_BYPRODUCTS
${_CLAD_LIBRARY_PATH}/cladPlugin.lib
${_CLAD_LIBRARY_PATH}/cladDifferentiator.lib
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why can't CMAKE_STATIC_LIBRARY_PREFIX and CMAKE_STATIC_LIBRARY_SUFFIX be used in case of Ninja on Windows?

Copy link
Member Author

@bellenot bellenot Jun 3, 2024

Choose a reason for hiding this comment

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

Well, I'll cross-check...

Copy link
Member Author

Choose a reason for hiding this comment

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

You were right. Fixed. Thanks!

else()
set(CLAD_BYPRODUCTS
${_CLAD_LIBRARY_PATH}/${CMAKE_STATIC_LIBRARY_PREFIX}cladPlugin${CMAKE_STATIC_LIBRARY_SUFFIX}
${_CLAD_LIBRARY_PATH}/${CMAKE_STATIC_LIBRARY_PREFIX}cladDifferentiator${CMAKE_STATIC_LIBRARY_SUFFIX}
)
endif()
endif()

if(APPLE)
Expand Down Expand Up @@ -86,8 +94,8 @@ ExternalProject_Add(
-DLLVM_DIR=${LLVM_BINARY_DIR}
-DCLANG_INCLUDE_DIRS=${CLANG_INCLUDE_DIRS}
${_clad_extra_cmake_args}
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config ${_clad_build_type}
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --config ${_clad_build_type} --target install
BUILD_COMMAND ${CMAKE_COMMAND} --build . ${EXTRA_BUILD_ARGS}
INSTALL_COMMAND ${CMAKE_COMMAND} --build . ${EXTRA_BUILD_ARGS} --target install
BUILD_BYPRODUCTS ${CLAD_BYPRODUCTS}
${_clad_cmake_logging_settings}
# We need the target clangBasic to be built before building clad. However, we
Expand Down
4 changes: 1 addition & 3 deletions main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ if(NOT WIN32)
endif()
ROOT_EXECUTABLE(root.exe rmain.cxx LIBRARIES Core Rint)
if(MSVC)
set(root_exports "/EXPORT:_Init_thread_abort /EXPORT:_Init_thread_epoch
/EXPORT:_Init_thread_footer /EXPORT:_Init_thread_header /EXPORT:_tls_index
/STACK:4000000 setargv.obj")
set(root_exports "/EXPORT:_Init_thread_abort /EXPORT:_Init_thread_epoch /EXPORT:_Init_thread_footer /EXPORT:_Init_thread_header /EXPORT:_tls_index /STACK:4000000 setargv.obj")
set_property(TARGET root.exe APPEND_STRING PROPERTY LINK_FLAGS ${root_exports})
add_custom_command(TARGET root.exe POST_BUILD
COMMAND mt -manifest ${ROOT_MANIFEST} -outputresource:${CMAKE_BINARY_DIR}/bin/root.exe)
Expand Down
2 changes: 1 addition & 1 deletion math/mathcore/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ ROOT_STANDARD_LIBRARY_PACKAGE(TrackMathCoreUnitDict
LINKDEF stress/TrackMathCoreLinkDef.h
DEPENDENCIES Core MathCore RIO GenVector Smatrix)

if(MSVC)
if(MSVC AND NOT CMAKE_GENERATOR MATCHES Ninja)
add_custom_command(TARGET TrackMathCoreUnitDict POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/libTrackMathCoreUnitDict.dll
${CMAKE_CURRENT_BINARY_DIR}/libTrackMathCoreUnitDict.dll)
Expand Down
5 changes: 3 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ ROOT_STANDARD_LIBRARY_PACKAGE(Event
HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Event.h
SOURCES Event.cxx LINKDEF EventLinkDef.h
DEPENDENCIES Hist MathCore)
if(MSVC)
if(MSVC AND NOT CMAKE_GENERATOR MATCHES Ninja)
if(NOT runtime_cxxmodules)
add_custom_command(TARGET Event POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/libEvent_rdict.pcm
Expand Down Expand Up @@ -208,7 +208,7 @@ ROOT_STANDARD_LIBRARY_PACKAGE(TrackMathCoreDict
HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/TrackMathCore.h
LINKDEF TrackMathCoreLinkDef.h
DEPENDENCIES Core MathCore RIO GenVector Smatrix)
if(MSVC)
if(MSVC AND NOT CMAKE_GENERATOR MATCHES Ninja)
add_custom_command(TARGET TrackMathCoreDict POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/libTrackMathCoreDict.dll
${CMAKE_CURRENT_BINARY_DIR}/libTrackMathCoreDict.dll)
Expand Down Expand Up @@ -252,6 +252,7 @@ if(WIN32)
set(cleantmpfiles POSTCMD cmd /c del AutoDict_*)
endif()
ROOT_ADD_TEST(test-stressinterpreter COMMAND stressInterpreter
WORKING_DIR ${CMAKE_BINARY_DIR}
PRECMD ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/stressInterpreter.cxx
$<TARGET_FILE_DIR:stressInterpreter>/stressInterpreter.cxx
${cleantmpfiles}
Expand Down
2 changes: 1 addition & 1 deletion test/RootShower/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ target_link_libraries(RootShower ROOT::Core ROOT::Rint ROOT::Gui ROOT::RIO ROOT:
ROOT::Graf ROOT::EG ROOT::Html ROOT::Geom ROOT::Tree
)
set_target_properties(RootShower PROPERTIES ENABLE_EXPORTS 1)
if(MSVC)
if(MSVC AND NOT CMAKE_GENERATOR MATCHES Ninja)
add_custom_command(TARGET RootShower POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/RootShower.exe
${CMAKE_CURRENT_BINARY_DIR}
Expand Down
2 changes: 1 addition & 1 deletion tree/dataframe/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ if(root7)
LINKDEF NTupleStructLinkDef.h
DEPENDENCIES RIO)
configure_file(NTupleStruct.hxx . COPYONLY)
if(MSVC)
if(MSVC AND NOT CMAKE_GENERATOR MATCHES Ninja)
add_custom_command(TARGET NTupleStruct POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/libNTupleStruct.dll
${CMAKE_CURRENT_BINARY_DIR}/libNTupleStruct.dll)
Expand Down
2 changes: 1 addition & 1 deletion tree/ntuple/v7/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ROOT_STANDARD_LIBRARY_PACKAGE(CustomStruct
LINKDEF CustomStructLinkDef.h
DEPENDENCIES RIO)
configure_file(CustomStruct.hxx . COPYONLY)
if(MSVC)
if(MSVC AND NOT CMAKE_GENERATOR MATCHES Ninja)
add_custom_command(TARGET CustomStruct POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/libCustomStruct.dll
${CMAKE_CURRENT_BINARY_DIR}/libCustomStruct.dll)
Expand Down
Loading
Loading