-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
73e6217
6c8eb68
00a3b14
0fe94e1
1f15273
19dcc3e
c89a065
4801e91
213eca2
181842a
e1443bf
4cc8d43
5815afb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
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") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wait, is this not in the There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why can't There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, I'll cross-check... There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
|
@@ -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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe better?
There was a problem hiding this comment.
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