From afd9d1b40a5f6e373446e9a26e86b1a8d76e9f3c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Peter=20K=C3=BCmmel?= Date: Wed, 4 Apr 2007 19:07:43 +0000 Subject: [PATCH] cmake: remove warning about const const, don't use pchs when compiling merged git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17721 a592a061-630c-0410-9148-cb99ea01b6c8 --- development/cmake/CMakeLists.txt | 5 ++-- development/cmake/modules/LyXMacros.cmake | 33 +++++++++-------------- 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/development/cmake/CMakeLists.txt b/development/cmake/CMakeLists.txt index a301d299f6..9953db3426 100644 --- a/development/cmake/CMakeLists.txt +++ b/development/cmake/CMakeLists.txt @@ -41,6 +41,7 @@ if(merge OR MERGE_FILES) message(STATUS "") message(STATUS "will merge all *.C files of a project into two files") message(STATUS "") + set(disable-pch 1) endif(merge OR MERGE_FILES) @@ -195,7 +196,7 @@ if(MSVC) # add here warnings which should produce an error /weXXXX SET(MSVC_W_ERROR "/we4101 /we4189") # add here warnings which should be disabled /wdXXXX - SET(MSVC_W_DISABLE "/wd4800 /wd4996 /wd4311 /wd4312 /wd4505 /wd4267 /wd4512 /wd4245 /wd4127") + SET(MSVC_W_DISABLE "/wd4800 /wd4996 /wd4311 /wd4312 /wd4505 /wd4267 /wd4512 /wd4245 /wd4127 /wd4180") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Wp64 ${MSVC_W_ERROR} ${MSVC_W_DISABLE}") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Wp64 ${MSVC_W_ERROR} ${MSVC_W_DISABLE}") @@ -210,7 +211,7 @@ if(MSVC) # add here warnings which should produce an error /weXXXX SET(MSVC_W_ERROR "/we4101 /we4189") # add here warnings which should be disabled /wdXXXX - SET(MSVC_W_DISABLE "/wd4800 /wd4996 /wd4267") + SET(MSVC_W_DISABLE "/wd4800 /wd4996 /wd4267 /wd4180") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${MSVC_W_ERROR} ${MSVC_W_DISABLE}") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${MSVC_W_ERROR} ${MSVC_W_DISABLE}") diff --git a/development/cmake/modules/LyXMacros.cmake b/development/cmake/modules/LyXMacros.cmake index 25f986059d..ad80d4c65d 100644 --- a/development/cmake/modules/LyXMacros.cmake +++ b/development/cmake/modules/LyXMacros.cmake @@ -148,27 +148,18 @@ macro(lyx_const_touched_files _allinone_name _new_list _list) if (_isGenerated) list(APPEND ${_new_list} ${_abs_FILE}) else (_isGenerated) - # don't include c-files in the final-file, because they usually come - # from a 3rd party and as such are not intended to be compiled all-in-one - string(REGEX MATCH ".+\\.c$" _isCFile ${_abs_FILE}) - if (_isCFile) - list(APPEND ${_new_list} ${_abs_FILE}) - else (_isCFile) - - GET_FILENAME_COMPONENT(_file_name ${_abs_FILE} NAME_WE) - STRING(REGEX REPLACE "-" "_" _file_name "${_file_name}" ) - set(__macro_name ${_file_name}___ASSUME_CONST) - - 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") - - file(APPEND ${_file_touched} "#ifndef ${__macro_name}\n") - file(APPEND ${_file_touched} "#include \"${_abs_FILE}\"\n") - file(APPEND ${_file_touched} "#endif\n\n") - - endif (_isCFile) + GET_FILENAME_COMPONENT(_file_name ${_abs_FILE} NAME_WE) + STRING(REGEX REPLACE "-" "_" _file_name "${_file_name}" ) + set(__macro_name ${_file_name}___ASSUME_CONST) + + 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") + + file(APPEND ${_file_touched} "#ifndef ${__macro_name}\n") + file(APPEND ${_file_touched} "#include \"${_abs_FILE}\"\n") + file(APPEND ${_file_touched} "#endif\n\n") endif (_isGenerated) endforeach (_current_FILE) endmacro(lyx_const_touched_files) -- 2.39.2