Initial commit
Change-Id: I26f6fdfd4962e2c724bf6b68893156f11d37d4b1
diff --git a/toolchains/common.cmake b/toolchains/common.cmake
new file mode 100644
index 0000000..552a8c8
--- /dev/null
+++ b/toolchains/common.cmake
@@ -0,0 +1,27 @@
+#
+# SPDX-License-Identifier: BSD-3-Clause
+# SPDX-FileCopyrightText: Copyright LibTL Contributors.
+#
+
+include_guard()
+
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
+
+add_compile_options(
+ "-fno-common"
+ "-ffunction-sections"
+ "-fdata-sections"
+ "-Wall"
+ "-Werror"
+ "-gdwarf-4"
+ "$<$<CONFIG:Debug>:-Og>"
+ "$<$<CONFIG:Release>:-g>"
+ )
+
+add_link_options(
+ "-Wl,--gc-sections"
+ "-g"
+ )