From 6ca10b47503fae43fca4ea0c2f6338fcc1d2e221 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Peter=20K=C3=BCmmel?= Date: Mon, 26 Mar 2007 18:03:56 +0000 Subject: [PATCH] also speed up compiling touched files under Linux git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17576 a592a061-630c-0410-9148-cb99ea01b6c8 --- .../cmake/boost/libs/filesystem/CMakeLists.txt | 1 - .../cmake/boost/libs/iostreams/CMakeLists.txt | 1 - .../cmake/boost/libs/signals/CMakeLists.txt | 1 - development/cmake/modules/LyXMacros.cmake | 14 +++++++------- development/cmake/src/CMakeLists.txt | 1 - development/cmake/src/frontends/CMakeLists.txt | 1 - .../cmake/src/frontends/controllers/CMakeLists.txt | 1 - development/cmake/src/frontends/qt4/CMakeLists.txt | 1 - development/cmake/src/graphics/CMakeLists.txt | 1 - development/cmake/src/insets/CMakeLists.txt | 1 - development/cmake/src/mathed/CMakeLists.txt | 1 - development/cmake/src/support/CMakeLists.txt | 1 - 12 files changed, 7 insertions(+), 18 deletions(-) diff --git a/development/cmake/boost/libs/filesystem/CMakeLists.txt b/development/cmake/boost/libs/filesystem/CMakeLists.txt index f31b520a93..7b34271b71 100644 --- a/development/cmake/boost/libs/filesystem/CMakeLists.txt +++ b/development/cmake/boost/libs/filesystem/CMakeLists.txt @@ -21,7 +21,6 @@ else(NOT MERGE_FILES) add_definitions(-D_WIN32_WINNT=0x500) lyx_merge_files(allinone boost_filesystem_sources) add_library(boost_filesystem STATIC - ${CMAKE_CURRENT_BINARY_DIR}/allinone.h ${CMAKE_CURRENT_BINARY_DIR}/allinone_const.C ${CMAKE_CURRENT_BINARY_DIR}/allinone_touched.C) endif(NOT MERGE_FILES) diff --git a/development/cmake/boost/libs/iostreams/CMakeLists.txt b/development/cmake/boost/libs/iostreams/CMakeLists.txt index bd6388146c..ebce005c90 100644 --- a/development/cmake/boost/libs/iostreams/CMakeLists.txt +++ b/development/cmake/boost/libs/iostreams/CMakeLists.txt @@ -21,7 +21,6 @@ if(NOT MERGE_FILES) else(NOT MERGE_FILES) lyx_merge_files(allinone boost_iostreams_sources) add_library(boost_iostreams STATIC - ${CMAKE_CURRENT_BINARY_DIR}/allinone.h ${CMAKE_CURRENT_BINARY_DIR}/allinone_const.C ${CMAKE_CURRENT_BINARY_DIR}/allinone_touched.C) diff --git a/development/cmake/boost/libs/signals/CMakeLists.txt b/development/cmake/boost/libs/signals/CMakeLists.txt index b3ac07cf8f..e7a13e5619 100644 --- a/development/cmake/boost/libs/signals/CMakeLists.txt +++ b/development/cmake/boost/libs/signals/CMakeLists.txt @@ -21,7 +21,6 @@ if(NOT MERGE_FILES) else(NOT MERGE_FILES) lyx_merge_files(allinone boost_signals_sources) add_library(boost_signals STATIC - ${CMAKE_CURRENT_BINARY_DIR}/allinone.h ${CMAKE_CURRENT_BINARY_DIR}/allinone_const.C ${CMAKE_CURRENT_BINARY_DIR}/allinone_touched.C) endif(NOT MERGE_FILES) diff --git a/development/cmake/modules/LyXMacros.cmake b/development/cmake/modules/LyXMacros.cmake index c0bef8b25e..660c4af968 100644 --- a/development/cmake/modules/LyXMacros.cmake +++ b/development/cmake/modules/LyXMacros.cmake @@ -135,13 +135,13 @@ macro (LYX_CREATE_FINAL_FILES _filenameCPP _filesExcludedFromFinalFile ) set(${_filesExcludedFromFinalFile}) file(WRITE ${_filenameCPP} "//autogenerated file\n") - set(_file_macros ${CMAKE_CURRENT_BINARY_DIR}/${_filenameCPP}.h) set(_file_const ${CMAKE_CURRENT_BINARY_DIR}/${_filenameCPP}_const.C) set(_file_touched ${CMAKE_CURRENT_BINARY_DIR}/${_filenameCPP}_touched.C) - file(WRITE ${_file_macros} "// undef the macro when working on this file \n\n\n") - file(WRITE ${_file_const} "// const files\n#include \"${_file_macros}\" \n\n\n") - file(WRITE ${_file_touched} "// touched files\n#include \"${_file_macros}\"\n\n\n") + file(WRITE ${_file_touched} "// touched files\n\n") + file(APPEND ${_file_touched} "// look for non-const files\n") + file(APPEND ${_file_touched} "#define DONT_INCLUDE_CONST_FILES\n") + file(APPEND ${_file_touched} "#include \"${_file_const}\"\n\n\n") foreach (_current_FILE ${ARGN}) get_filename_component(_abs_FILE ${_current_FILE} ABSOLUTE) @@ -161,10 +161,10 @@ macro (LYX_CREATE_FINAL_FILES _filenameCPP _filesExcludedFromFinalFile ) GET_FILENAME_COMPONENT(_file_name ${_abs_FILE} NAME_WE) STRING(REGEX REPLACE "-" "_" _file_name "${_file_name}" ) - set(__macro_name ASSUME_CONST_____${_file_name}) - file(APPEND ${_file_macros} "#define ${__macro_name}\n") + set(__macro_name ${_file_name}___ASSUME_CONST) - file(APPEND ${_file_const} "#ifdef ${__macro_name}\n") + file(APPEND ${_file_const} "#define ${__macro_name}\n") + file(APPEND ${_file_const} "#if defined(${__macro_name}) && !defined(DONT_INCLUDE_CONST_FILES)\n") file(APPEND ${_file_const} "#include \"${_abs_FILE}\"\n") file(APPEND ${_file_const} "#endif\n\n") diff --git a/development/cmake/src/CMakeLists.txt b/development/cmake/src/CMakeLists.txt index a0e70e45f2..bffaeef559 100644 --- a/development/cmake/src/CMakeLists.txt +++ b/development/cmake/src/CMakeLists.txt @@ -45,7 +45,6 @@ if(NOT MERGE_FILES) else(NOT MERGE_FILES) lyx_merge_files(allinone lyx_sources) set(lyx_sources - ${CMAKE_CURRENT_BINARY_DIR}/allinone.h ${CMAKE_CURRENT_BINARY_DIR}/allinone_const.C ${CMAKE_CURRENT_BINARY_DIR}/allinone_touched.C ${CMAKE_CURRENT_BINARY_DIR}/version.C diff --git a/development/cmake/src/frontends/CMakeLists.txt b/development/cmake/src/frontends/CMakeLists.txt index 991289f32a..4f1d234f5f 100644 --- a/development/cmake/src/frontends/CMakeLists.txt +++ b/development/cmake/src/frontends/CMakeLists.txt @@ -23,7 +23,6 @@ if(NOT MERGE_FILES) else(NOT MERGE_FILES) lyx_merge_files(allinone frontends_sources) add_library(frontends STATIC - ${CMAKE_CURRENT_BINARY_DIR}/allinone.h ${CMAKE_CURRENT_BINARY_DIR}/allinone_const.C ${CMAKE_CURRENT_BINARY_DIR}/allinone_touched.C) endif(NOT MERGE_FILES) diff --git a/development/cmake/src/frontends/controllers/CMakeLists.txt b/development/cmake/src/frontends/controllers/CMakeLists.txt index de97a654c1..2c1517d4d6 100644 --- a/development/cmake/src/frontends/controllers/CMakeLists.txt +++ b/development/cmake/src/frontends/controllers/CMakeLists.txt @@ -18,7 +18,6 @@ if(NOT MERGE_FILES) else(NOT MERGE_FILES) lyx_merge_files(allinone controllers_sources) add_library(controllers STATIC - ${CMAKE_CURRENT_BINARY_DIR}/allinone.h ${CMAKE_CURRENT_BINARY_DIR}/allinone_const.C ${CMAKE_CURRENT_BINARY_DIR}/allinone_touched.C) endif(NOT MERGE_FILES) diff --git a/development/cmake/src/frontends/qt4/CMakeLists.txt b/development/cmake/src/frontends/qt4/CMakeLists.txt index 659881d3e1..d39ff3a0fc 100644 --- a/development/cmake/src/frontends/qt4/CMakeLists.txt +++ b/development/cmake/src/frontends/qt4/CMakeLists.txt @@ -42,7 +42,6 @@ if(MERGE_FILES) SET_SOURCE_FILES_PROPERTIES(allinone_const.C PROPERTIES OBJECT_DEPENDS "${depends_moc_uic}") SET_SOURCE_FILES_PROPERTIES(allinone_touched.C PROPERTIES OBJECT_DEPENDS "${depends_moc_uic}") add_library(frontend_qt4 STATIC - ${CMAKE_CURRENT_BINARY_DIR}/allinone.h ${CMAKE_CURRENT_BINARY_DIR}/allinone_const.C ${CMAKE_CURRENT_BINARY_DIR}/allinone_touched.C ${frontends_qt4_headers} diff --git a/development/cmake/src/graphics/CMakeLists.txt b/development/cmake/src/graphics/CMakeLists.txt index 6458ba0ccc..e6c2c2f1c7 100644 --- a/development/cmake/src/graphics/CMakeLists.txt +++ b/development/cmake/src/graphics/CMakeLists.txt @@ -19,7 +19,6 @@ if(NOT MERGE_FILES) else(NOT MERGE_FILES) lyx_merge_files(allinone graphics_sources) add_library(graphics STATIC - ${CMAKE_CURRENT_BINARY_DIR}/allinone.h ${CMAKE_CURRENT_BINARY_DIR}/allinone_const.C ${CMAKE_CURRENT_BINARY_DIR}/allinone_touched.C) endif(NOT MERGE_FILES) diff --git a/development/cmake/src/insets/CMakeLists.txt b/development/cmake/src/insets/CMakeLists.txt index 0ff0327f12..1e0fa5c6a6 100644 --- a/development/cmake/src/insets/CMakeLists.txt +++ b/development/cmake/src/insets/CMakeLists.txt @@ -21,7 +21,6 @@ if(NOT MERGE_FILES) else(NOT MERGE_FILES) lyx_merge_files(allinone insets_sources) add_library(insets STATIC - ${CMAKE_CURRENT_BINARY_DIR}/allinone.h ${CMAKE_CURRENT_BINARY_DIR}/allinone_const.C ${CMAKE_CURRENT_BINARY_DIR}/allinone_touched.C) endif(NOT MERGE_FILES) diff --git a/development/cmake/src/mathed/CMakeLists.txt b/development/cmake/src/mathed/CMakeLists.txt index dbfb2094c0..3ba1de93d8 100644 --- a/development/cmake/src/mathed/CMakeLists.txt +++ b/development/cmake/src/mathed/CMakeLists.txt @@ -22,7 +22,6 @@ if(NOT MERGE_FILES) else(NOT MERGE_FILES) lyx_merge_files(allinone mathed_sources) add_library(mathed STATIC - ${CMAKE_CURRENT_BINARY_DIR}/allinone.h ${CMAKE_CURRENT_BINARY_DIR}/allinone_const.C ${CMAKE_CURRENT_BINARY_DIR}/allinone_touched.C) endif(NOT MERGE_FILES) diff --git a/development/cmake/src/support/CMakeLists.txt b/development/cmake/src/support/CMakeLists.txt index fdc66f1807..70bac0afb8 100644 --- a/development/cmake/src/support/CMakeLists.txt +++ b/development/cmake/src/support/CMakeLists.txt @@ -37,7 +37,6 @@ else(NOT MERGE_FILES) list(REVERSE support_sources) lyx_merge_files(allinone support_sources) add_library(support STATIC - ${CMAKE_CURRENT_BINARY_DIR}/allinone.h ${CMAKE_CURRENT_BINARY_DIR}/allinone_const.C ${CMAKE_CURRENT_BINARY_DIR}/allinone_touched.C) -- 2.39.2