[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 05/14: set c/c++ standard in cmake so that
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 05/14: set c/c++ standard in cmake so that we are not dependent on the default c/c++ standard set by the specific compiler. |
Date: |
Mon, 30 May 2016 21:23:22 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch master
in repository gnuradio.
commit 7862cf2e70fa497e50e96c11f9347c7adeccfc77
Author: Stefan Wunsch <address@hidden>
Date: Wed May 18 14:52:49 2016 +0200
set c/c++ standard in cmake so that we are not dependent on the default
c/c++ standard set by the specific compiler.
---
CMakeLists.txt | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3641ab4..6e767ed 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -54,6 +54,31 @@ include(GrVersion) #setup version info
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O2")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O2")
+# Set C/C++ standard for all targets
+# NOTE: Starting with cmake v3.1 this should be used:
+# set(CMAKE_C_STANDARD 90)
+# set(CMAKE_CXX_STANDARD 98)
+
+IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98")
+ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98")
+ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98")
+ELSE()
+ message(warning "C++ standard could not be set because compiler is not
GNU, Clang or MSVC.")
+ENDIF()
+
+IF(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
+ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "Clang")
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
+ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
+ELSE()
+ message(warning "C standard could not be set because compiler is not GNU,
Clang or MSVC.")
+ENDIF()
+
########################################################################
# Environment setup
########################################################################
- [Commit-gnuradio] [gnuradio] branch master updated (0e1b710 -> 0d32337), git, 2016/05/30
- [Commit-gnuradio] [gnuradio] 10/14: Merge remote-tracking branch 'osh/fixwarn', git, 2016/05/30
- [Commit-gnuradio] [gnuradio] 01/14: CMake: Generate GnuradioConfig.cmake with a hardcoded install path hint, git, 2016/05/30
- [Commit-gnuradio] [gnuradio] 13/14: Merge remote-tracking branch 'adi/fix_find_volk', git, 2016/05/30
- [Commit-gnuradio] [gnuradio] 02/14: CMake: Fix search paths for the Volk submodule in GnuradioConfig.cmake, git, 2016/05/30
- [Commit-gnuradio] [gnuradio] 04/14: dtv: Fix usage of volk_32f_index_max*, first argument, to be uint16_t* as required by the Volk API., git, 2016/05/30
- [Commit-gnuradio] [gnuradio] 12/14: Merge remote-tracking branch 'stwunsch/master', git, 2016/05/30
- [Commit-gnuradio] [gnuradio] 05/14: set c/c++ standard in cmake so that we are not dependent on the default c/c++ standard set by the specific compiler.,
git <=
- [Commit-gnuradio] [gnuradio] 06/14: Merge branch 'maint', git, 2016/05/30
- [Commit-gnuradio] [gnuradio] 03/14: grc: hide comments of hidden variables, git, 2016/05/30
- [Commit-gnuradio] [gnuradio] 14/14: Merge branch 'maint', git, 2016/05/30
- [Commit-gnuradio] [gnuradio] 07/14: volk: updated to latest master b930d7f, git, 2016/05/30
- [Commit-gnuradio] [gnuradio] 09/14: Merge remote-tracking branch 'michaelld/fix_volk_max_index_uint16_t', git, 2016/05/30
- [Commit-gnuradio] [gnuradio] 11/14: Merge remote-tracking branch 'gnuradio-wg-grc/master_grcwg', git, 2016/05/30
- [Commit-gnuradio] [gnuradio] 08/14: blocks: fix angry min_xx_impl warningsx, git, 2016/05/30