serge1 / ELFIO

ELFIO - ELF (Executable and Linkable Format) reader and producer implemented as a header only C++ library
http://serge1.github.io/ELFIO
MIT License
720 stars 155 forks source link

Enabled C++11 in CMake #57

Closed MaxXSoft closed 3 years ago

MaxXSoft commented 3 years ago

Added set(CMAKE_CXX_STANDARD 11) to CMakeLists.txt to enable C++11 support, otherwise, the build process may fail when building the examples.

serge1 commented 3 years ago

@MaxXSoft, thank you for your submission!

Hi @a4z and @schultetwin1,

I don't feel comfortable with CMake yet and I don't know how this PR may affect 'conan' and 'vcpkg' integrations. Would it be possible for your to review the PR?

Thank you, Serge

serge1 commented 3 years ago

I have opened discussion #59 dedicated to this PR

serge1 commented 3 years ago

Hi @MaxXSoft,

Based on the feedback received at #59, would you please resubmit PR putting CMAKE_CXX_STANDARD into a conditional statement that checks for ELFIO_BUILD_EXAMPLES and ELFIO_BUILD_TESTS

MaxXSoft commented 3 years ago

Hi @serge1,

I've put CMAKE_CXX_STANDARD in a conditional statement to ensure that C++11 will only be enabled when building examples and tests.

serge1 commented 3 years ago

Accepted and merged! Thank you!

a4z commented 3 years ago

just FYI, in case you did not know, you can also set the C++ standard on target level, the it will never be global

set_target_properties(the_target
    PROPERTIES
        CXX_STANDARD 11
        CXX_STANDARD_REQUIRED YES
        CXX_EXTENSIONS NO
)
MaxXSoft commented 3 years ago

just FYI, in case you did not know, you can also set the C++ standard on target level, the it will never be global

set_target_properties(the_target
    PROPERTIES
        CXX_STANDARD 11
        CXX_STANDARD_REQUIRED YES
        CXX_EXTENSIONS NO
)

Glad to know that, thank you!