summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/Compiler')
-rw-r--r--Modules/Compiler/ADSP-C.cmake11
-rw-r--r--Modules/Compiler/ADSP-CXX.cmake16
-rw-r--r--Modules/Compiler/ADSP-DetermineCompiler.cmake13
-rw-r--r--Modules/Compiler/ADSP.cmake26
4 files changed, 60 insertions, 6 deletions
diff --git a/Modules/Compiler/ADSP-C.cmake b/Modules/Compiler/ADSP-C.cmake
new file mode 100644
index 0000000..cef3fb1
--- /dev/null
+++ b/Modules/Compiler/ADSP-C.cmake
@@ -0,0 +1,11 @@
+include(Compiler/CMakeCommonCompilerMacros)
+include(Compiler/ADSP)
+
+__compiler_adsp(C)
+
+set(CMAKE_C90_STANDARD_COMPILE_OPTION -c89)
+set(CMAKE_C90_STANDARD__HAS_FULL_SUPPORT ON)
+
+set(CMAKE_C99_STANDARD__HAS_FULL_SUPPORT ON)
+
+__compiler_check_default_language_standard(C 8.0.0.0 99)
diff --git a/Modules/Compiler/ADSP-CXX.cmake b/Modules/Compiler/ADSP-CXX.cmake
new file mode 100644
index 0000000..b01cab1
--- /dev/null
+++ b/Modules/Compiler/ADSP-CXX.cmake
@@ -0,0 +1,16 @@
+include(Compiler/CMakeCommonCompilerMacros)
+include(Compiler/ADSP)
+
+__compiler_adsp(CXX)
+
+set(CMAKE_CXX98_STANDARD_COMPILE_OPTION -c++)
+set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION -g++)
+set(CMAKE_CXX98_STANDARD__HAS_FULL_SUPPORT ON)
+
+if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.3.0.0)
+ set(CMAKE_CXX11_STANDARD_COMPILE_OPTION -c++11)
+ set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION -c++11 -g++)
+ set(CMAKE_CXX11_STANDARD__HAS_FULL_SUPPORT ON)
+endif()
+
+__compiler_check_default_language_standard(CXX 8.0.0.0 98)
diff --git a/Modules/Compiler/ADSP-DetermineCompiler.cmake b/Modules/Compiler/ADSP-DetermineCompiler.cmake
index 0340f69..96c88f9 100644
--- a/Modules/Compiler/ADSP-DetermineCompiler.cmake
+++ b/Modules/Compiler/ADSP-DetermineCompiler.cmake
@@ -1,10 +1,11 @@
-set(_compiler_id_pp_test "defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)")
+set(_compiler_id_pp_test "defined(_ADI_COMPILER)")
set(_compiler_id_version_compute "
-#if defined(__VISUALDSPVERSION__)
- /* __VISUALDSPVERSION__ = 0xVVRRPP00 */
-# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_HEX@(__VISUALDSPVERSION__>>24)
-# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_HEX@(__VISUALDSPVERSION__>>16 & 0xFF)
-# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_HEX@(__VISUALDSPVERSION__>>8 & 0xFF)
+#if defined(__VERSIONNUM__)
+ /* __VERSIONNUM__ = 0xVVRRPPTT */
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__VERSIONNUM__ >> 24 & 0xFF)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__VERSIONNUM__ >> 16 & 0xFF)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__VERSIONNUM__ >> 8 & 0xFF)
+# define @PREFIX@COMPILER_VERSION_TWEAK @MACRO_DEC@(__VERSIONNUM__ & 0xFF)
#endif")
diff --git a/Modules/Compiler/ADSP.cmake b/Modules/Compiler/ADSP.cmake
new file mode 100644
index 0000000..62566a0
--- /dev/null
+++ b/Modules/Compiler/ADSP.cmake
@@ -0,0 +1,26 @@
+include_guard()
+
+set(CMAKE_EXECUTABLE_SUFFIX ".dxe")
+
+macro(__compiler_adsp lang)
+ set(CMAKE_${lang}_OUTPUT_EXTENSION ".doj")
+
+ set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-flags-link" " ")
+ set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP ",")
+
+ set(_CMAKE_${lang}_ADSP_FLAGS "-proc=${CMAKE_ADSP_PROCESSOR}")
+
+ set(CMAKE_${lang}_COMPILE_OBJECT
+ "<CMAKE_${lang}_COMPILER> ${_CMAKE_${lang}_ADSP_FLAGS} <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>")
+
+ set(CMAKE_${lang}_CREATE_STATIC_LIBRARY
+ "<CMAKE_${lang}_COMPILER> ${_CMAKE_${lang}_ADSP_FLAGS} -build-lib -o <TARGET> <CMAKE_${lang}_LINK_FLAGS> <OBJECTS>")
+
+ set(CMAKE_${lang}_LINK_EXECUTABLE
+ "<CMAKE_${lang}_COMPILER> ${_CMAKE_${lang}_ADSP_FLAGS} <FLAGS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
+
+ unset(_CMAKE_${lang}_ADSP_FLAGS)
+
+ set(CMAKE_${lang}_CREATE_SHARED_LIBRARY)
+ set(CMAKE_${lang}_CREATE_MODULE_LIBRARY)
+endmacro()