The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=15580 
====================================================================== 
Reported By:                J McG
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15580
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2015-05-22 06:06 EDT
Last Modified:              2015-05-22 06:06 EDT
====================================================================== 
Summary:                    PROTOBUF_GENERATE_CPP does not add
__attribute__(const|pure) to the suitable, generated, functions.
Description: 
FindProtobuf.cmake makes the PROTOBUF_GENERATE_CPP macro available. If I attempt
to add_compile_options(-Wall -Wsuggest-attribute=pure -Wsuggest-attribute=const)
I note that the generated code has not had these optimisation options applied.

Steps to Reproduce: 
1. find_package(ProtoBuf)
2. add_compile_options(-Wall -Wsuggest-attribute=pure -Wsuggest-attribute=const)
3. PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS ${PROTOCOLS})
4. add_library(${PROJECT_NAME} OBJECT ${PROTO_SRCS} ${PROTO_HDRS})


Additional Information: 
Surely modifying the generator to add these attribute to the function generator
should be pretty easy.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2015-05-22 06:06 J McG          New Issue                                    
======================================================================

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to