Skip to content

Commit

Permalink
only update qgsexpression_texts.cpp if there are actual changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Sep 30, 2015
1 parent 928504a commit 83fd65a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
)
Expand Down

2 comments on commit 83fd65a

@jef-n
Copy link
Member Author

@jef-n jef-n commented on 83fd65a Sep 30, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dakcarto this might help

@dakcarto
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.