Skip to content
Snippets Groups Projects
Commit 198252a1 authored by Guilherme Amadio's avatar Guilherme Amadio
Browse files

builtins/pcre: use build byproducts only for Ninja

This allows us to use generator expressions for the
library name to also fix the build on Windows.
parent 63d1720e
No related branches found
No related tags found
No related merge requests found
...@@ -6,12 +6,20 @@ foreach(var PCRE_FOUND PCRE_VERSION PCRE_INCLUDE_DIR PCRE_PCRE_LIBRARY PCRE_LIBR ...@@ -6,12 +6,20 @@ foreach(var PCRE_FOUND PCRE_VERSION PCRE_INCLUDE_DIR PCRE_PCRE_LIBRARY PCRE_LIBR
unset(${var} CACHE) unset(${var} CACHE)
endforeach() endforeach()
if(winrtdebug) if(WIN32)
set(DEBUG_POSTFIX d) set(PCRE_POSTFIX $<$<CONFIG:Debug>:d>)
endif() endif()
set(PCRE_VERSION "8.42" CACHE INTERNAL "" FORCE) set(PCRE_VERSION "8.42" CACHE INTERNAL "" FORCE)
set(PCRE_LIBNAME ${CMAKE_STATIC_LIBRARY_PREFIX}pcre${DEBUG_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) set(PCRE_LIBNAME ${CMAKE_STATIC_LIBRARY_PREFIX}pcre${PCRE_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
# build byproducts only needed by Ninja
if("${CMAKE_GENERATOR}" STREQUAL "Ninja")
set(PCRE_BYPRODUCTS
<BINARY_DIR>/pcre.h
<BINARY_DIR>/${PCRE_LIBNAME}
)
endif()
ExternalProject_Add(PCRE ExternalProject_Add(PCRE
URL ${CMAKE_CURRENT_SOURCE_DIR}/pcre-${PCRE_VERSION}.tar.gz URL ${CMAKE_CURRENT_SOURCE_DIR}/pcre-${PCRE_VERSION}.tar.gz
...@@ -35,8 +43,7 @@ ExternalProject_Add(PCRE ...@@ -35,8 +43,7 @@ ExternalProject_Add(PCRE
${CMAKE_COMMAND} --build <BINARY_DIR> --config $<CONFIG> --target pcre ${CMAKE_COMMAND} --build <BINARY_DIR> --config $<CONFIG> --target pcre
BUILD_BYPRODUCTS BUILD_BYPRODUCTS
<BINARY_DIR>/pcre.h ${PCRE_BYPRODUCTS}
<BINARY_DIR>/${CMAKE_CFG_INTDIR}/${PCRE_LIBNAME}
INSTALL_COMMAND "" INSTALL_COMMAND ""
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment