Skip to content

Commit

Permalink
xplat: add ChakraCoreHeaders target.
Browse files Browse the repository at this point in the history
This target automatically copies the ChakraCore Headers to the the path
that cmake is ran from under the include folder. This makes it easier to
find the headers needed for ChakraCore Development.

V2: add suggestions mentioned by review in pull request chakra-core#2129.
  • Loading branch information
kphillisjr committed Dec 8, 2016
1 parent 21d1b6c commit 9b3a0cf
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bin/ChakraCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,8 @@ if(NOT CC_XCODE_PROJECT)
"${CHAKRACORE_BINARY_DIR}/bin/ChakraCore/libChakraCoreStatic.a"
"${CHAKRACORE_BINARY_DIR}/"
)
if(TARGET ChakraCoreHeaders)
add_dependencies(ChakraCore ChakraCoreHeaders)
add_dependencies(ChakraCoreStatic ChakraCoreHeaders)
endif()
endif()
16 changes: 16 additions & 0 deletions lib/Jsrt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,19 @@ target_include_directories (
../Runtime/Debug
../Parser
)

if(NOT CC_XCODE_PROJECT)
add_custom_target(ChakraCoreHeaders ALL
COMMAND ${CMAKE_COMMAND} -E make_directory
"${CMAKE_BINARY_DIR}/include"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_CURRENT_SOURCE_DIR}/ChakraCore.h"
"${CMAKE_BINARY_DIR}/include"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_CURRENT_SOURCE_DIR}/ChakraCommon.h"
"${CMAKE_BINARY_DIR}/include"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_CURRENT_SOURCE_DIR}/ChakraDebug.h"
"${CMAKE_BINARY_DIR}/include"
)
endif()

0 comments on commit 9b3a0cf

Please sign in to comment.