Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add daemon watch mode to ecompile (#630)
* Add libefsw at 3419347 * saving work * some cleanup * move to fs::paths * saving work.. maybe hitting a limit with number of watched dirs? * migrate to watching only ecompile.cfg specified folders, cleanup/doc * Display summary between compilations in watch mode; fix cache reuse * Fix inf loop; some cmake, format changes... * some windows compilation fixes... tweaks to windows cmake? * Update Efsw.cmake for build lib changes * removed debug flag * silence efsw build dont add antlr project if it already exists * Address review comments: - use std::move on efswwatcher add_* * add docs * Add WatchModeByDefault ecompile.cfg option * iniital work on tests * Add CI actions * some changes (passes locally on win, mac, linux) * Fix fixtures dependency; use ecompile verbose mode * Add core-changes * Send ctrl+c instead of killing process * Proper Python file naming * Kill ecompile process on windows, SIGINT otherwise --------- Co-authored-by: turleypol <turley@polserver.com>
- Loading branch information
Showing
28 changed files
with
1,071 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,5 @@ Makefile | |
/CMakeSettings.json | ||
__pycache__ | ||
gen/ | ||
build/ | ||
build/ | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,4 @@ ipch | |
module_defs | ||
coretest | ||
fmt | ||
efsw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
message("* libefsw") | ||
|
||
set (EFSW_REPOSITORY "https://github.com/SpartanJ/efsw.git") | ||
set (EFSW_VERSION_REF "3419347") | ||
|
||
set (EFSW_SOURCE_DIR "${POL_EXT_LIB_DIR}/efsw-${EFSW_VERSION_REF}") | ||
set (EFSW_INSTALL_DIR "${EFSW_SOURCE_DIR}/build") | ||
|
||
if (${windows}) | ||
set (EFSW_LIB "${EFSW_INSTALL_DIR}/lib/efsw-static.lib" ) | ||
else() | ||
set (EFSW_LIB "${EFSW_INSTALL_DIR}/lib/libefsw-static.a" ) | ||
endif() | ||
|
||
set (EFSW_ARGS ${EFSW_FLAGS} | ||
-DCMAKE_INSTALL_PREFIX=${EFSW_INSTALL_DIR} | ||
-DCMAKE_BUILD_TYPE=Release | ||
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} | ||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} | ||
-DCMAKE_OSX_ARCHITECTURES=${PIPED_OSX_ARCHITECTURES} | ||
-DBUILD_TEST_APP=OFF | ||
-DBUILD_SHARED_LIBS=ON # The -static file isn't installed unless this is enabled? | ||
-DBUILD_STATIC_LIBS=ON | ||
-DCMAKE_USER_MAKE_RULES_OVERRIDE_CXX=${CMAKE_CURRENT_LIST_DIR}/cxx_flag_overrides.cmake | ||
-DCMAKE_USER_MAKE_RULES_OVERRIDE=${CMAKE_CURRENT_LIST_DIR}/c_flag_overrides.cmake | ||
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded | ||
) | ||
|
||
if(NOT EXISTS ${EFSW_LIB}) | ||
ExternalProject_Add(libefsw_ext | ||
GIT_REPOSITORY ${EFSW_REPOSITORY} | ||
GIT_TAG ${EFSW_VERSION_REF} | ||
GIT_SHALLOW TRUE | ||
PREFIX efsw | ||
LIST_SEPARATOR | | ||
CMAKE_ARGS ${EFSW_ARGS} | ||
SOURCE_DIR "${EFSW_SOURCE_DIR}" | ||
BUILD_IN_SOURCE 1 | ||
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release | ||
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --config Release --target install | ||
BUILD_BYPRODUCTS ${EFSW_LIB} | ||
EXCLUDE_FROM_ALL 1 | ||
LOG_DOWNLOAD 1 | ||
LOG_CONFIGURE 1 | ||
LOG_BUILD 1 | ||
LOG_INSTALL 1 | ||
LOG_OUTPUT_ON_FAILURE 1 | ||
) | ||
else() | ||
message(" - already built") | ||
endif() | ||
|
||
add_library(libefsw STATIC IMPORTED) | ||
set_target_properties(libefsw PROPERTIES | ||
IMPORTED_LOCATION ${EFSW_LIB} | ||
IMPORTED_IMPLIB ${EFSW_LIB} | ||
INTERFACE_INCLUDE_DIRECTORIES ${EFSW_INSTALL_DIR}/include | ||
FOLDER 3rdParty | ||
) | ||
if(APPLE) | ||
find_library(CoreFoundation_Library CoreFoundation) | ||
find_library(CoreServices_Library CoreServices) | ||
set_property(TARGET libefsw APPEND | ||
PROPERTY INTERFACE_LINK_LIBRARIES | ||
${CoreFoundation_Library} ${CoreServices_Library}) | ||
endif() | ||
|
||
if(NOT EXISTS ${EFSW_LIB}) | ||
file(MAKE_DIRECTORY ${EFSW_INSTALL_DIR}/include) #directory has to exist during configure | ||
add_dependencies(libefsw libefsw_ext) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
find_package(Python3 COMPONENTS Interpreter REQUIRED QUIET) | ||
execute_process( | ||
COMMAND ${Python3_EXECUTABLE} ${testdir}/ecompile_watch_test.py ${ecompile} | ||
COMMAND_ECHO STDOUT | ||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR} | ||
RESULT_VARIABLE res | ||
TIMEOUT 600 | ||
) | ||
if(NOT "${res}" STREQUAL "0") | ||
message(SEND_ERROR "${res}") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ curl-* | |
boost_* | ||
zlib-* | ||
cppdap-* | ||
efsw-* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.