File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ if (ENABLE_STEPCODE)
1717 ExternalProject_Add (STEPCODE_BLD
1818 URL "${CMAKE_CURRENT_SOURCE_DIR } /stepcode"
1919 BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS}
20- PATCH_COMMAND ${PATCH_EXECUTABLE } ;-E;-p1; ${PATCH_OPTIONS} ;-i; ${CMAKE_CURRENT_SOURCE_DIR } /expparse.patch
20+ PATCH_COMMAND ${CMAKE_COMMAND } ;-DSOURCE_DIR= ${ CMAKE_CURRENT_SOURCE_DIR } /stepcode;-DDEST_DIR=< SOURCE_DIR >;-P; ${CMAKE_CURRENT_SOURCE_DIR } /RefreshSource.cmake
2121 CMAKE_ARGS
2222 ${BUILD_TYPE_SPECIFIER}
2323 -DBIN_DIR=${BIN_DIR}
@@ -34,7 +34,7 @@ if (ENABLE_STEPCODE)
3434 $<$<BOOL :${PERPLEX_TARGET} >:-DPERPLEX_TEMPLATE =${CMAKE_NOBUNDLE_INSTALL_PREFIX} /${DATA_DIR} /perplex /perplex_template .c >
3535 $<$<BOOL :${PERPLEX_TARGET} >:-DRE2C_ROOT =${CMAKE_NOBUNDLE_INSTALL_PREFIX} >
3636 -DSC_BUILD_SCHEMAS=
37- -DSC_EXP2CXX_CHUNK_SIZE=256
37+ -DSC_EXP2CXX_CHUNK_SIZE=64:8
3838 -DSC_ENABLE_COVERAGE=OFF
3939 -DSC_ENABLE_TESTING=OFF
4040 -DSC_IS_SUBBUILD=ON
Original file line number Diff line number Diff line change 1+ if (NOT DEFINED SOURCE_DIR OR NOT IS_DIRECTORY "${SOURCE_DIR} " )
2+ message (FATAL_ERROR "SOURCE_DIR is not a directory: ${SOURCE_DIR} " )
3+ endif ()
4+
5+ if (NOT DEFINED DEST_DIR OR DEST_DIR STREQUAL "" )
6+ message (FATAL_ERROR "DEST_DIR is not defined" )
7+ endif ()
8+
9+ cmake_path (ABSOLUTE_PATH SOURCE_DIR NORMALIZE OUTPUT_VARIABLE source_abs )
10+ cmake_path (ABSOLUTE_PATH DEST_DIR NORMALIZE OUTPUT_VARIABLE dest_abs )
11+ if (source_abs STREQUAL dest_abs)
12+ message (FATAL_ERROR "Refusing to refresh a source directory from itself" )
13+ endif ()
14+
15+ cmake_path (GET dest_abs FILENAME dest_name )
16+ if (NOT dest_name STREQUAL "STEPCODE_BLD" )
17+ message (FATAL_ERROR "Refusing to remove unexpected destination: ${dest_abs} " )
18+ endif ()
19+
20+ # ExternalProject runs PATCH_COMMAND with DEST_DIR as its current working
21+ # directory. Removing DEST_DIR itself invalidates that working directory and
22+ # causes the next patch command to fail. Keep the directory inode, but remove
23+ # all of its contents so overlapping patches and patches which add files are
24+ # always applied to pristine input when PATCH_COMMAND is rerun without the
25+ # local-directory download step.
26+ file (GLOB dest_entries LIST_DIRECTORIES TRUE
27+ "${dest_abs} /*"
28+ "${dest_abs} /.[!.]*"
29+ "${dest_abs} /..?*"
30+ )
31+ if (dest_entries)
32+ file (REMOVE_RECURSE ${dest_entries} )
33+ endif ()
34+ file (COPY "${source_abs} /" DESTINATION "${dest_abs} "
35+ PATTERN ".git" EXCLUDE
36+ )
Load diff This file was deleted.
You can’t perform that action at this time.
0 commit comments