summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rondeau <tom@trondeau.com>2013-12-12 10:50:29 -0500
committerTom Rondeau <tom@trondeau.com>2013-12-12 12:34:13 -0500
commit79085fefe1392f4663523adafafa8f3fd48c4ba0 (patch)
tree05edbd194297973948f12f48659600eb36f90436
parent5a16f39a60ad9a87b391c3b3264c4a4551dc9082 (diff)
cmake: adds compiler info to gnuradio-config-info and removes use of csv file.
-rw-r--r--CMakeLists.txt11
-rw-r--r--gnuradio-runtime/CMakeLists.txt6
-rw-r--r--gnuradio-runtime/apps/gnuradio-config-info.cc12
-rw-r--r--gnuradio-runtime/include/gnuradio/constants.h15
-rw-r--r--gnuradio-runtime/lib/constants.cc.in18
5 files changed, 54 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d2c597e41c..785d78b047 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -110,10 +110,17 @@ execute_process(COMMAND ${CMAKE_C_COMPILER} --version
OUTPUT_VARIABLE cmake_c_compiler_version)
execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version
OUTPUT_VARIABLE cmake_cxx_compiler_version)
-MESSAGE(STATUS "Compiler Version: ${cmake_c_compiler_version}")
set(COMPILER_INFO "${CMAKE_C_COMPILER}:::${CMAKE_C_FLAGS_${GRCBTU}} ${CMAKE_C_FLAGS}\n${CMAKE_CXX_COMPILER}:::${CMAKE_CXX_FLAGS_${GRCBTU}} ${CMAKE_CXX_FLAGS}\n" )
+
+# Convert to a C string to compile and display properly
+string(STRIP "${cmake_c_compiler_version}" cmake_c_compiler_version)
+string(STRIP "${cmake_cxx_compiler_version}" cmake_cxx_compiler_version)
+string(STRIP ${COMPILER_INFO} COMPILER_INFO)
+MESSAGE(STATUS "Compiler Version: ${cmake_c_compiler_version}")
MESSAGE(STATUS "Compiler Flags: ${COMPILER_INFO}")
-FILE(WRITE ${CMAKE_BINARY_DIR}/compilerinfo.csv "${COMPILER_INFO}\nVERSION:${cmake_c_compiler_version}\nVERSION:${cmake_cxx_compiler_version}")
+string(REPLACE "\n" " \\n" cmake_c_compiler_version ${cmake_c_compiler_version})
+string(REPLACE "\n" " \\n" cmake_cxx_compiler_version ${cmake_cxx_compiler_version})
+string(REPLACE "\n" " \\n" COMPILER_INFO ${COMPILER_INFO})
########################################################################
# Install directories
diff --git a/gnuradio-runtime/CMakeLists.txt b/gnuradio-runtime/CMakeLists.txt
index c95470b5bb..f7733db628 100644
--- a/gnuradio-runtime/CMakeLists.txt
+++ b/gnuradio-runtime/CMakeLists.txt
@@ -175,12 +175,6 @@ install(
COMPONENT "runtime_devel"
)
-install(
- FILES ${CMAKE_BINARY_DIR}/compilerinfo.csv
- DESTINATION ${GR_PYTHON_DIR}/gnuradio/gr
- COMPONENT "runtime_python"
-)
-
########################################################################
# Setup ControlPort preferences file and installation information
########################################################################
diff --git a/gnuradio-runtime/apps/gnuradio-config-info.cc b/gnuradio-runtime/apps/gnuradio-config-info.cc
index 19291f4dae..2e0cb5d139 100644
--- a/gnuradio-runtime/apps/gnuradio-config-info.cc
+++ b/gnuradio-runtime/apps/gnuradio-config-info.cc
@@ -42,6 +42,9 @@ main(int argc, char **argv)
("sysconfdir", "print gnuradio system configuration directory")
("prefsdir", "print gnuradio preferences directory")
("builddate", "print gnuradio build date (RFC2822 format)")
+ ("cc", "print gnuradio C compiler version")
+ ("cxx", "print gnuradio C++ compiler version")
+ ("cflags", "print gnuradio CFLAGS")
("version,v", "print gnuradio version")
;
@@ -68,5 +71,14 @@ main(int argc, char **argv)
if(vm.count("version"))
std::cout << gr::version() << std::endl;
+ if(vm.count("cc"))
+ std::cout << gr::c_compiler() << std::endl;
+
+ if(vm.count("cxx"))
+ std::cout << gr::cxx_compiler() << std::endl;
+
+ if(vm.count("cflags"))
+ std::cout << gr::compiler_flags() << std::endl;
+
return 0;
}
diff --git a/gnuradio-runtime/include/gnuradio/constants.h b/gnuradio-runtime/include/gnuradio/constants.h
index beba6f2745..5e4a20f4ee 100644
--- a/gnuradio-runtime/include/gnuradio/constants.h
+++ b/gnuradio-runtime/include/gnuradio/constants.h
@@ -53,6 +53,21 @@ namespace gr {
*/
GR_RUNTIME_API const std::string version();
+ /*!
+ * \brief return C compiler used to build this version of GNU Radio
+ */
+ GR_RUNTIME_API const std::string c_compiler();
+
+ /*!
+ * \brief return C++ compiler used to build this version of GNU Radio
+ */
+ GR_RUNTIME_API const std::string cxx_compiler();
+
+ /*!
+ * \brief return C and C++ compiler flags used to build this version of GNU Radio
+ */
+ GR_RUNTIME_API const std::string compiler_flags();
+
} /* namespace gr */
#endif /* INCLUDED_GR_CONSTANTS_H */
diff --git a/gnuradio-runtime/lib/constants.cc.in b/gnuradio-runtime/lib/constants.cc.in
index 828c4397f7..7173c60792 100644
--- a/gnuradio-runtime/lib/constants.cc.in
+++ b/gnuradio-runtime/lib/constants.cc.in
@@ -58,4 +58,22 @@ namespace gr {
return "@VERSION@";
}
+ const std::string
+ c_compiler()
+ {
+ return "@cmake_c_compiler_version@";
+ }
+
+ const std::string
+ cxx_compiler()
+ {
+ return "@cmake_cxx_compiler_version@";
+ }
+
+ const std::string
+ compiler_flags()
+ {
+ return "@COMPILER_INFO@";
+ }
+
} /* namespace gr */