Skip to content

Commit

Permalink
Merge remote-tracking branch 'bradking/cxx-std' (ATDV-303)
Browse files Browse the repository at this point in the history
This is the TriBITS merge related to trilinos/Trilinos#6814

Build/Test Cases Summary
Enabled Packages:
Enabled all Packages
0) MPI_DEBUG => passed: passed=376,notpassed=0 (2.49 min)
1) SERIAL_RELEASE => passed: passed=376,notpassed=0 (1.79 min)
Other local commits for this build/test group: 008ec59, 6b082ca, ebcea2d, 8b16479
  • Loading branch information
bartlettroscoe committed May 12, 2020
2 parents ef63bae + 008ec59 commit 7579e18
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 376 deletions.
55 changes: 23 additions & 32 deletions test/core/CompilerOptions_UnitTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,20 @@ FUNCTION(UNITEST_GCC_BASE_OPTIONS)
MESSAGE("*** Testing GCC base compiler options")
MESSAGE("***\n")

BODY_UNITEST_GCC_BASE_OPTIONS()

ENDFUNCTION()

MACRO(BODY_UNITEST_GCC_BASE_OPTIONS)

TRIBITS_SET_ALL_COMPILER_ID(GNU)

TRIBITS_COMPILE_OPTIONS_COMMON_ACTIONS()

UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS
" -pedantic -Wall -Wno-long-long -std=c99" )
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS
" -pedantic -Wall -Wno-long-long -std=c++98 -Wwrite-strings" )
" -pedantic -Wall -Wno-long-long -Wwrite-strings" )
UNITTEST_COMPARE_CONST( CMAKE_Fortran_FLAGS "" )
UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS_DEBUG "-g -O0" )
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS_DEBUG "-g -O0" )
Expand All @@ -108,7 +114,7 @@ FUNCTION(UNITEST_GCC_BASE_OPTIONS)
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" )
UNITTEST_COMPARE_CONST( CMAKE_Fortran_FLAGS_RELEASE "-O3" )

ENDFUNCTION()
ENDMACRO()


FUNCTION(UNITEST_GCC_STD_OVERRIDE_OPTIONS)
Expand All @@ -125,7 +131,7 @@ FUNCTION(UNITEST_GCC_STD_OVERRIDE_OPTIONS)
UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS
" -pedantic -Wall -Wno-long-long -std=c34" )
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS
" -pedantic -Wall -Wno-long-long -std=c++98 -Wwrite-strings" )
" -pedantic -Wall -Wno-long-long -Wwrite-strings" )
UNITTEST_COMPARE_CONST( CMAKE_Fortran_FLAGS "" )
UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS_DEBUG "-g -O0" )
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS_DEBUG "-g -O0" )
Expand All @@ -143,23 +149,10 @@ FUNCTION(UNITEST_GCC_ENABLE_CXX11_OPTIONS)
MESSAGE("*** Testing GCC with C++11 enabled")
MESSAGE("***\n")

# This option has been removed. Test that it has no effect.
SET(${PROJECT_NAME}_ENABLE_CXX11 ON)

TRIBITS_SET_ALL_COMPILER_ID(GNU)

TRIBITS_COMPILE_OPTIONS_COMMON_ACTIONS()

UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS
" -pedantic -Wall -Wno-long-long -std=c99" )
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS
" -pedantic -Wall -Wno-long-long -Wwrite-strings" )
UNITTEST_COMPARE_CONST( CMAKE_Fortran_FLAGS "" )
UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS_DEBUG "-g -O0" )
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS_DEBUG "-g -O0" )
UNITTEST_COMPARE_CONST( CMAKE_Fortran_FLAGS_DEBUG "-g -O0" )
UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG" )
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" )
UNITTEST_COMPARE_CONST( CMAKE_Fortran_FLAGS_RELEASE "-O3" )
BODY_UNITEST_GCC_BASE_OPTIONS()

ENDFUNCTION()

Expand Down Expand Up @@ -187,7 +180,7 @@ FUNCTION(UNITEST_GCC_PROJECT_DEFINED_STRONG_C_OPTIONS)
UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS
" -common-opt1 -common-opt2 -std=cverygood" )
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS
" -common-opt1 -common-opt2 -std=c++98 -Wwrite-strings" )
" -common-opt1 -common-opt2 -Wwrite-strings" )
UNITTEST_COMPARE_CONST( CMAKE_Fortran_FLAGS "" )
UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS_DEBUG "-g -O0" )
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS_DEBUG "-g -O0" )
Expand All @@ -206,7 +199,6 @@ FUNCTION(UNITEST_GCC_PROJECT_DEFINED_STRONG_CXX_OPTIONS)
MESSAGE("***\n")

MULTILINE_SET(DummyProject_CXX_STRONG_COMPILE_WARNING_FLAGS
" -std=c++98" # C++98 standard code
" -pedantic" # Adds more static checking to remove non-ANSI GNU extensions
" -Wall" # Enable a bunch of default warnings
" -Wno-long-long" # Allow long long int since it is used by MPI, SWIG, etc.
Expand All @@ -219,7 +211,7 @@ FUNCTION(UNITEST_GCC_PROJECT_DEFINED_STRONG_CXX_OPTIONS)
UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS
" -pedantic -Wall -Wno-long-long -std=c99" )
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS
" -std=c++98 -pedantic -Wall -Wno-long-long" )
" -pedantic -Wall -Wno-long-long" )
UNITTEST_COMPARE_CONST( CMAKE_Fortran_FLAGS "" )
UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS_DEBUG "-g -O0" )
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS_DEBUG "-g -O0" )
Expand All @@ -245,7 +237,6 @@ FUNCTION(UNITEST_GCC_PROJECT_DEFINED_STRONG_C_CXX_OPTIONS)
)

MULTILINE_SET(DummyProject_CXX_STRONG_COMPILE_WARNING_FLAGS
"-std=c++98" # C++98 standard code
" -pedantic" # Adds more static checking to remove non-ANSI GNU extensions
" -Wall" # Enable a bunch of default warnings
" -Wno-long-long" # Allow long long int since it is used by MPI, SWIG, etc.
Expand All @@ -260,7 +251,7 @@ FUNCTION(UNITEST_GCC_PROJECT_DEFINED_STRONG_C_CXX_OPTIONS)
UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS
"-std=c99 -pedantic -Wall -Wno-long-long" )
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS
"-std=c++98 -pedantic -Wall -Wno-long-long -Wwrite-strings" )
" -pedantic -Wall -Wno-long-long -Wwrite-strings" )
UNITTEST_COMPARE_CONST( CMAKE_Fortran_FLAGS "" )
UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS_DEBUG "-g -O0" )
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS_DEBUG "-g -O0" )
Expand All @@ -287,7 +278,7 @@ FUNCTION(UNITEST_GCC_WITH_SHADOW_OPTIONS)
UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS
" -pedantic -Wall -Wno-long-long -std=c99" )
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS
" -pedantic -Wall -Wno-long-long -std=c++98 -Wwrite-strings -Wshadow -Woverloaded-virtual" )
" -pedantic -Wall -Wno-long-long -Wwrite-strings -Wshadow -Woverloaded-virtual" )
UNITTEST_COMPARE_CONST( CMAKE_Fortran_FLAGS "" )
UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS_DEBUG "-g -O0" )
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS_DEBUG "-g -O0" )
Expand Down Expand Up @@ -315,7 +306,7 @@ FUNCTION(UNITEST_GCC_GLOBAL_ENABLE_SHADOW_OPTIONS)
UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS
" -pedantic -Wall -Wno-long-long -std=c99" )
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS
" -pedantic -Wall -Wno-long-long -std=c++98 -Wwrite-strings -Wshadow -Woverloaded-virtual" )
" -pedantic -Wall -Wno-long-long -Wwrite-strings -Wshadow -Woverloaded-virtual" )
UNITTEST_COMPARE_CONST( CMAKE_Fortran_FLAGS "" )
UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS_DEBUG "-g -O0" )
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS_DEBUG "-g -O0" )
Expand All @@ -342,7 +333,7 @@ FUNCTION(UNITEST_GCC_GLOBAL_DISABLE_SHADOW_OPTIONS)
UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS
" -pedantic -Wall -Wno-long-long -std=c99" )
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS
" -pedantic -Wall -Wno-long-long -std=c++98 -Wwrite-strings" )
" -pedantic -Wall -Wno-long-long -Wwrite-strings" )
UNITTEST_COMPARE_CONST( CMAKE_Fortran_FLAGS "" )
UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS_DEBUG "-g -O0" )
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS_DEBUG "-g -O0" )
Expand All @@ -368,7 +359,7 @@ FUNCTION(UNITEST_GCC_WITH_COVERAGE_OPTIONS)
UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS
" -pedantic -Wall -Wno-long-long -std=c99 -fprofile-arcs -ftest-coverage" )
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS
" -pedantic -Wall -Wno-long-long -std=c++98 -Wwrite-strings -fprofile-arcs -ftest-coverage" )
" -pedantic -Wall -Wno-long-long -Wwrite-strings -fprofile-arcs -ftest-coverage" )
UNITTEST_COMPARE_CONST( CMAKE_Fortran_FLAGS
"-fprofile-arcs -ftest-coverage" )
UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS_DEBUG "-g -O0" )
Expand All @@ -395,7 +386,7 @@ FUNCTION(UNITEST_GCC_WITH_CHECKED_STL_OPTIONS)
UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS
" -pedantic -Wall -Wno-long-long -std=c99 -D_GLIBCXX_DEBUG" )
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS
" -pedantic -Wall -Wno-long-long -std=c++98 -Wwrite-strings -D_GLIBCXX_DEBUG" )
" -pedantic -Wall -Wno-long-long -Wwrite-strings -D_GLIBCXX_DEBUG" )
UNITTEST_COMPARE_CONST( CMAKE_Fortran_FLAGS " -D_GLIBCXX_DEBUG" )
UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS_DEBUG "-g -O0" )
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS_DEBUG "-g -O0" )
Expand All @@ -421,7 +412,7 @@ FUNCTION(UNITEST_GCC_WITH_CLEANED_OPTIONS)
UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS
"--warnings_as_errors_placeholder -pedantic -Wall -Wno-long-long -std=c99" )
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS
"--warnings_as_errors_placeholder -pedantic -Wall -Wno-long-long -std=c++98 -Wwrite-strings" )
"--warnings_as_errors_placeholder -pedantic -Wall -Wno-long-long -Wwrite-strings" )
UNITTEST_COMPARE_CONST( CMAKE_Fortran_FLAGS "" )
UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS_DEBUG "-g -O0" )
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS_DEBUG "-g -O0" )
Expand Down Expand Up @@ -574,7 +565,7 @@ FUNCTION(UNITEST_GCC_WITH_SHADOW_CLEANED_CHECKED_STL_COVERAGE_OPTIONS)
UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS
"--warnings_as_errors_placeholder -pedantic -Wall -Wno-long-long -std=c99 -fprofile-arcs -ftest-coverage -D_GLIBCXX_DEBUG" )
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS
"--warnings_as_errors_placeholder -pedantic -Wall -Wno-long-long -std=c++98 -Wwrite-strings -Wshadow -Woverloaded-virtual -fprofile-arcs -ftest-coverage -D_GLIBCXX_DEBUG" )
"--warnings_as_errors_placeholder -pedantic -Wall -Wno-long-long -Wwrite-strings -Wshadow -Woverloaded-virtual -fprofile-arcs -ftest-coverage -D_GLIBCXX_DEBUG" )
UNITTEST_COMPARE_CONST( CMAKE_Fortran_FLAGS "-fprofile-arcs -ftest-coverage -D_GLIBCXX_DEBUG" )
UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS_DEBUG "-g -O0" )
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS_DEBUG "-g -O0" )
Expand Down Expand Up @@ -610,7 +601,7 @@ FUNCTION(UNITEST_GCC_ADDITIONAL_USER_OPTIONS)
UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS
" -pedantic -Wall -Wno-long-long -std=c99 --additional-user-c-flags" )
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS
" -pedantic -Wall -Wno-long-long -std=c++98 -Wwrite-strings --additional-user-cxx-flags" )
" -pedantic -Wall -Wno-long-long -Wwrite-strings --additional-user-cxx-flags" )
UNITTEST_COMPARE_CONST( CMAKE_Fortran_FLAGS " --additional-user-fortran-flags" )
UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS_DEBUG "-g -O0" )
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS_DEBUG "-g -O0" )
Expand Down Expand Up @@ -722,7 +713,7 @@ FUNCTION(UNITEST_GCC_WITH_DEBUG_SYMBOLES_OPTIONS)
UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS
" -pedantic -Wall -Wno-long-long -std=c99 -g" )
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS
" -pedantic -Wall -Wno-long-long -std=c++98 -Wwrite-strings -g" )
" -pedantic -Wall -Wno-long-long -Wwrite-strings -g" )
UNITTEST_COMPARE_CONST( CMAKE_Fortran_FLAGS " -g" )
UNITTEST_COMPARE_CONST( CMAKE_C_FLAGS_DEBUG "-g -O0" )
UNITTEST_COMPARE_CONST( CMAKE_CXX_FLAGS_DEBUG "-g -O0" )
Expand Down
16 changes: 15 additions & 1 deletion tribits/ReleaseNotes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,21 @@
Release Notes for TriBITS
----------------------------------------

2108/10/10:
2020/04/16:

(*) MAJOR: TriBITS Core: CMAKE_CXX_STANDARD is now always set to at least 11
to enable C++11 support. The ${PROJECT_NAME}_ENABLE_CXX11 option has been
removed, but a variable of the same name is hard-coded to ON for
compatibility.

(*) MAJOR: TriBITS Core: CMAKE_CXX_FLAGS will no longer contain an explicit
C++ standard option like '-std=c++11'. TriBITS clients' dependents
using CMake will still compile with support for C++11 language constructs
because libraries come with INTERFACE_COMPILE_FEATURES including cxx_std_11.
However, those using Makefile.export.<Package> files will no longer get
a '-std=c++11` flag from TriBITS.

2018/10/10:

(*) MAJOR: TriBITS Core: Changed minimum CMake version from 2.8.11 to 3.10.0.

Expand Down
Loading

0 comments on commit 7579e18

Please sign in to comment.