Skip to content

Commit 17cba35

Browse files
authored
Mark flibcpp as standards compliant
Don't assume compiler extensions are needed: use `-std=c++11` not `-std=gnu++11`
1 parent e80620d commit 17cba35

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

CMakeLists.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ option(BUILD_TESTING "Enable CTest" ${_DEFAULT_BUILD_TESTING})
4343

4444
# Fortran standard
4545
set(FLIBCPP_FORTRAN_STD "03" CACHE STRING
46-
"Fortran standard for compiling generated code (options: 03/08/15/18)")
46+
"Fortran standard for compiling generated code (options: 03/08/15/18/none)")
4747
if (FLIBCPP_FORTRAN_STD AND NOT FLIBCPP_FORTRAN_STD STREQUAL "none")
4848
if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
4949
set(_FLIBCPP_STD_FLAGS "-std=f20${FLIBCPP_FORTRAN_STD}")
@@ -166,6 +166,9 @@ function(flibcpp_add_module name)
166166
PRIVATE
167167
cxx_std_11
168168
)
169+
# Compile with e.g. std=c++11 instead of =gnu++11
170+
set_property(TARGET ${name} PROPERTY CXX_EXTENSIONS OFF)
171+
169172
if (_FLIBCPP_STD_FLAGS)
170173
# Compile Fortran code with a particular standard
171174
target_compile_options(${name}

0 commit comments

Comments
 (0)