Skip to content

Commit

Permalink
Add Ninja support on Windows (#16690)
Browse files Browse the repository at this point in the history
* [cmake][windows] Add Ninja support on Windows

* [cmake][win] Fix native build (without Ninja)
  • Loading branch information
bellenot authored and jenkins committed Oct 17, 2024
1 parent a0eda35 commit 4e787ef
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tools/plugins/clad/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set(CLAD_INCLUDE_DIRS ${clad_install_dir})
# Clad Libraries
set(CLAD_CXX_FLAGS ${CMAKE_CXX_FLAGS})
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()
Expand All @@ -23,16 +23,17 @@ if(MSVC)
if(asan)
set(CLAD_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ASAN_EXTRA_CXX_FLAGS}")
endif()
set(EXTRA_BUILD_ARGS --config ${_clad_build_type})
endif(MSVC)
if(NOT _clad_build_type STREQUAL "" AND NOT _clad_build_type STREQUAL ".")
set(EXTRA_BUILD_ARGS --config ${_clad_build_type})
endif()
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")
if(CMAKE_GENERATOR MATCHES Ninja)
set(CLAD_BYPRODUCTS
${_CLAD_LIBRARY_PATH}/${CMAKE_STATIC_LIBRARY_PREFIX}cladPlugin${CMAKE_STATIC_LIBRARY_SUFFIX}
${_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()
Expand Down

0 comments on commit 4e787ef

Please sign in to comment.