summaryrefslogtreecommitdiff
path: root/cmake/intel-quark-d2000.toolchain.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/intel-quark-d2000.toolchain.cmake')
-rw-r--r--cmake/intel-quark-d2000.toolchain.cmake63
1 files changed, 14 insertions, 49 deletions
diff --git a/cmake/intel-quark-d2000.toolchain.cmake b/cmake/intel-quark-d2000.toolchain.cmake
index 3537551..03925a7 100644
--- a/cmake/intel-quark-d2000.toolchain.cmake
+++ b/cmake/intel-quark-d2000.toolchain.cmake
@@ -32,28 +32,9 @@ set(BASE_FLAGS "-std=c90 -Wall -Wextra -Werror -Wno-unused-parameter")
set(INCLUDES "")
-if (IS_DIRECTORY "${QMSI_DIR}")
- message("Using QMSI_DIR: ${QMSI_DIR}")
-else ()
- message("Detecting QMSI_DIR..")
-
- find_path(QMSI_DIR qm_common.h
- HINTS "${ISSM_DIR}/firmware/bsp/1.0/include"
- NO_DEFAULT_PATH)
-
- if (IS_DIRECTORY "${QMSI_DIR}")
- message("Found QMSI_DIR: ${QMSI_DIR}")
- else ()
- message(FATAL_ERROR "Could not find QMSI directory")
- endif ()
-
-endif ()
-
# TODO: these directories should be validated
-list(APPEND includes "${ISSM_DIR}/firmware/bsp/1.0/include")
-list(APPEND includes "${ISSM_DIR}/firmware/bsp/1.0/board/drivers")
-#list(APPEND includes "${ISSM_DIR}/firmware/bsp/1.0/drivers/include")
-list(APPEND includes "${ISSM_DIR}/firmware/bsp/1.0/drivers/bmc150")
+#list(APPEND includes "${ISSM_DIR}/firmware/bsp/1.0/include")
+#list(APPEND includes "${ISSM_DIR}/firmware/bsp/1.0/board/drivers")
if (INTEL_QUARK_CHIP STREQUAL D2000)
include("${toolchain_dir}/intel/d2000.cmake")
@@ -64,27 +45,13 @@ if (INTEL_QUARK_CHIP STREQUAL D2000)
include("${toolchain_dir}/intel/gdb.cmake")
gdb_init()
+
+ include("${toolchain_dir}/intel/qmsi.cmake")
+ qmsi_init()
elseif (INTEL_QUARK_CHIP STREQUAL SE)
- list(APPEND includes "${ISSM_DIR}/firmware/bsp/1.0/soc/quark_se/include")
+# list(APPEND includes "${ISSM_DIR}/firmware/bsp/1.0/soc/quark_se/include")
endif ()
-# QMSI Library
-file(GLOB_RECURSE qmsi_sources ${ISSM_DIR}/firmware/bsp/1.0/drivers/*.c)
-add_library(qmsi STATIC ${qmsi_sources})
-target_include_directories(qmsi PUBLIC "${ISSM_DIR}/firmware/bsp/1.0/drivers/include")
-
-# SYS Library - dunno if this really is the best name
-file(GLOB_RECURSE intel_sys ${ISSM_DIR}/firmware/bsp/1.0/sys/*.c)
-add_library(intel_sys STATIC ${intel_sys})
-#target_include_directories(intel_sys PUBLIC "${ISSM_DIR}/firmware/bsp/1.0/drivers/include")
-target_link_libraries(intel_sys PRIVATE qmsi)
-
-# BMC Library
-file(GLOB_RECURSE bmc_sources ${ISSM_DIR}/firmware/bsp/1.0/board/drivers/bmc150/*.c)
-add_library(bmc STATIC ${bmc_sources})
-target_link_libraries(bmc PRIVATE qmsi)
-target_include_directories(bmc PUBLIC "${ISSM_DIR}/firmware/bsp/1.0/board/drivers/bmc150")
-
# IPP Library
#file(GLOB_RECURSE ipp_sources ${ISSM_DIR}/firmware/lib/ipp/1.0.0/*.c)
add_library(ipp STATIC IMPORTED)
@@ -136,7 +103,7 @@ set(o_level "$<TARGET_PROPERTY:O_LEVEL>")
add_compile_options("$<$<BOOL:${o_level}>:-O${o_level}>$<$<NOT:$<BOOL:${o_level}>>:-O3>")
unset(o_level)
-include_directories("${includes}")
+#include_directories("${includes}")
set(CMAKE_C_FLAGS "${BASE_FLAGS} ${TARGET_FLAGS} " CACHE STRING "c flags")
set(CMAKE_CXX_FLAGS "${BASE_FLAGS} ${TARGET_FLAGS} -fno-exceptions -fno-rtti -felide-constructors -std=c++14" CACHE STRING "c++ flags")
@@ -154,6 +121,7 @@ set(CMAKE_EXE_LINKER_FLAGS "${linker_flags}" CACHE STRING "linker flags" FORCE)
#unset(linker_flags)
set(GCC "${ISSM_DIR}/tools/compiler/bin/${TRIPLE}-gcc")
+#set(GCC "/usr/bin/clang++-3.9")
if (NOT EXISTS "${GCC}")
message(FATAL_ERROR "Could not find ${TRIPLE}-gcc. Is $ISSM_DIR set correctly?")
@@ -167,6 +135,7 @@ endif ()
# cmake_force_cxx_compiler("${GXX}" GNU)
cmake_force_c_compiler("${GCC}" GNU)
+#cmake_force_c_compiler("${GCC}" LLVM)
# search for programs in the build elfinfo directories
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
@@ -176,16 +145,12 @@ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
function(toolchain_target TARGET)
add_dependencies("${TARGET}" elfinfo)
- target_link_libraries("${TARGET}" intel_sys)
- target_link_libraries("${TARGET}" qmsi)
- target_link_libraries("${TARGET}" ipp)
- target_link_libraries("${TARGET}" bmc)
- target_link_libraries("${TARGET}" softfp)
- target_link_libraries("${TARGET}" c)
- target_link_libraries("${TARGET}" g)
- # target_link_libraries("${TARGET}" gcc)
+ target_link_libraries("${TARGET}" PUBLIC ipp)
+ target_link_libraries("${TARGET}" PUBLIC softfp)
+ target_link_libraries("${TARGET}" PUBLIC c)
+ target_link_libraries("${TARGET}" PUBLIC g)
target_compile_definitions("${TARGET}" PUBLIC -D__IPP_ENABLED__)
- target_link_libraries("${TARGET}" "-Xlinker" "-T${ld_file}")
+ target_link_libraries("${TARGET}" PUBLIC "-Xlinker" "-T${ld_file}")
endfunction()
# elfinfo tools