Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more C++-standard-related CMake options to the build system #76

Closed
s3rvac opened this issue Jan 1, 2018 · 1 comment
Closed

Add more C++-standard-related CMake options to the build system #76

s3rvac opened this issue Jan 1, 2018 · 1 comment

Comments

@s3rvac
Copy link
Member

s3rvac commented Jan 1, 2018

In addition to set(CMAKE_CXX_STANDARD 14), we should add the following two options into CMakeLists.txt:

  1. set(CMAKE_CXX_STANDARD_REQUIRED ON) This makes C++14 a requirement and prevents a "decay" to C++98 when the compiler does not support C++14. RetDec and related tools require C++14 to build, so the sooner the build fails the better.
  2. set(CMAKE_CXX_EXTENSIONS OFF) This disables the use of compiler-specific extensions. For example, by default, CMake passes -std=gnu++14 to GCC on Linux. We want to build with -std=c++14 to prevent use of non-portable compiler extensions, which is what the disabling of this option does.

Note: These changes should be added to all our repositories.

s3rvac added a commit to avast/pelib that referenced this issue Feb 4, 2018
set(CMAKE_CXX_STANDARD_REQUIRED ON)
This makes C++14 a requirement and prevents a "decay" to C++98 when the
compiler does not support C++14. RetDec and related tools require C++14 to
build, so the sooner the build fails the better.

set(CMAKE_CXX_EXTENSIONS OFF)
This disables the use of compiler-specific extensions. For example, by default,
CMake passes -std=gnu++14 to GCC on Linux. We want to build with -std=c++14 to
prevent use of non-portable compiler extensions, which is what the disabling of
this option does.

For more details, see avast/retdec#76
s3rvac added a commit to avast/capstone-dumper that referenced this issue Feb 4, 2018
set(CMAKE_CXX_STANDARD_REQUIRED ON)
This makes C++14 a requirement and prevents a "decay" to C++98 when the
compiler does not support C++14. RetDec and related tools require C++14 to
build, so the sooner the build fails the better.

set(CMAKE_CXX_EXTENSIONS OFF)
This disables the use of compiler-specific extensions. For example, by default,
CMake passes -std=gnu++14 to GCC on Linux. We want to build with -std=c++14 to
prevent use of non-portable compiler extensions, which is what the disabling of
this option does.

For more details, see avast/retdec#76
s3rvac added a commit to avast/retdec-idaplugin that referenced this issue Feb 4, 2018
set(CMAKE_CXX_STANDARD_REQUIRED ON)
This makes C++14 a requirement and prevents a "decay" to C++98 when the
compiler does not support C++14. RetDec and related tools require C++14 to
build, so the sooner the build fails the better.

set(CMAKE_CXX_EXTENSIONS OFF)
This disables the use of compiler-specific extensions. For example, by default,
CMake passes -std=gnu++14 to GCC on Linux. We want to build with -std=c++14 to
prevent use of non-portable compiler extensions, which is what the disabling of
this option does.

For more details, see avast/retdec#76
s3rvac added a commit that referenced this issue Feb 4, 2018
set(CMAKE_CXX_STANDARD_REQUIRED ON)
This makes C++14 a requirement and prevents a "decay" to C++98 when the
compiler does not support C++14. RetDec and related tools require C++14 to
build, so the sooner the build fails the better.

set(CMAKE_CXX_EXTENSIONS OFF)
This disables the use of compiler-specific extensions. For example, by default,
CMake passes -std=gnu++14 to GCC on Linux. We want to build with -std=c++14 to
prevent use of non-portable compiler extensions, which is what the disabling of
this option does.
s3rvac added a commit that referenced this issue Feb 4, 2018
@s3rvac s3rvac self-assigned this Feb 4, 2018
@s3rvac
Copy link
Member Author

s3rvac commented Feb 4, 2018

I have added the build settings to all our repositories that did not have them:

@s3rvac s3rvac closed this as completed Feb 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant