Skip to content
Permalink
Browse files

only update qgsexpression_texts.cpp if there are actual changes

  • Loading branch information
jef-n committed Sep 30, 2015
1 parent 928504a commit 83fd65ab610b0fc8018035eb0e38db98c858b212
Showing with 3 additions and 2 deletions.
  1. +1 −1 {resources → scripts}/process_function_template.py
  2. +2 −1 src/core/CMakeLists.txt
@@ -3,7 +3,7 @@
import json
import glob

cpp = open("src/core/qgsexpression_texts.cpp", "w")
cpp = open(sys.argv[1], "w")
cpp.write(
"#include \"qgsexpression.h\"\n"
"\n"
@@ -332,7 +332,8 @@ STRING(REPLACE "$" "$$" JSON_HELP_FILES "${JSON_HELP_FILES}")
STRING(REPLACE "\(" "\\(" JSON_HELP_FILES "${JSON_HELP_FILES}")
STRING(REPLACE "\)" "\\)" JSON_HELP_FILES "${JSON_HELP_FILES}")
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/qgsexpression_texts.cpp
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/resources/process_function_template.py
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/scripts/process_function_template.py ${CMAKE_CURRENT_BINARY_DIR}/qgsexpression_texts.cpp.temp
COMMAND ${CMAKE_COMMAND} -DSRC=${CMAKE_CURRENT_BINARY_DIR}/qgsexpression_texts.cpp.temp -DDST=${CMAKE_CURRENT_SOURCE_DIR}/qgsexpression_texts.cpp -P ${CMAKE_SOURCE_DIR}/cmake/CopyIfChanged.cmake
DEPENDS ${JSON_HELP_FILES}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)

2 comments on commit 83fd65a

@jef-n

This comment has been minimized.

Copy link
Member Author

@jef-n jef-n replied Sep 30, 2015

@dakcarto this might help

@dakcarto

This comment has been minimized.

Copy link
Member

@dakcarto dakcarto replied Oct 1, 2015

Hi @jef-n,

Yes, that definitely helps, also on GCC where the compile time for the file was reasonable (even on older Mac at ~ 30s).

However, with Clang and Release or RelWithDebInfo builds, the compile time, when texts have changed or a with a clean build, is still very long, as reported. Any qualms with adding the patch noted here to reduce optimization on that one file?

Please sign in to comment.
You can’t perform that action at this time.