mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-03 08:28:25 +00:00
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
This commit is contained in:
parent
3ed7a430d5
commit
afd9d1b40a
@ -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}")
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user