Skip to content

Commit

Permalink
Add more C++-standard-related CMake options to CMakeLists.txt (#76).
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
s3rvac committed Feb 4, 2018
1 parent 6489bd2 commit f4e7a63
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ option(RETDEC_TESTS "Build tests." OFF)
option(RETDEC_DEV_TOOLS "Build dev tools." OFF)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

# On Linux and macOS, set RPATH relative to the origin of the installed
# executables (i.e. relative to the bin directory). This allows us to move the
Expand Down

0 comments on commit f4e7a63

Please sign in to comment.