git subrepo clone git@github.com:compihu/platform-test-f4-ll.git platforms/platform-test-f4-ll
subrepo: subdir: "platforms/platform-test-f4-ll" merged: "bc41134" upstream: origin: "git@github.com:compihu/platform-test-f4-ll.git" branch: "master" commit: "bc41134" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "87ee373"
This commit is contained in:
parent
46ce55c6a0
commit
95af4ce0d8
460 changed files with 84105 additions and 0 deletions
|
@ -0,0 +1,19 @@
|
|||
# Create target to discover tests
|
||||
function (cpputest_buildtime_discover_tests EXECUTABLE)
|
||||
# The path to the discover script depends on execution mode:
|
||||
# - internal (building CppUTest it self).
|
||||
# - imported (installed, imported, and executed by a client of the CppUTest lib)
|
||||
if (PROJECT_NAME STREQUAL "CppUTest") # internal - (path is relative to source dir)
|
||||
SET(DISCOVER_SCRIPT ${PROJECT_SOURCE_DIR}/cmake/Scripts/CppUTestBuildTimeDiscoverTests.cmake)
|
||||
else (PROJECT_NAME STREQUAL "CppUTest") # Installed (path is relative to install directory)
|
||||
SET(DISCOVER_SCRIPT ${CppUTest_DIR}/Scripts/CppUTestBuildTimeDiscoverTests.cmake)
|
||||
endif (PROJECT_NAME STREQUAL "CppUTest")
|
||||
|
||||
add_custom_command (TARGET ${EXECUTABLE}
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -DTESTS_DETAILED:BOOL=${TESTS_DETAILED} -DEXECUTABLE=$<TARGET_FILE:${EXECUTABLE}> -P ${DISCOVER_SCRIPT}
|
||||
VERBATIM
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Discovering Tests in ${EXECUTABLE}"
|
||||
VERBATIM)
|
||||
endfunction ()
|
|
@ -0,0 +1,110 @@
|
|||
if (MSVC)
|
||||
set(CPP_PLATFORM VisualCpp)
|
||||
include_directories(${CppUTestRootDirectory}/include/Platforms/${CPP_PLATFORM})
|
||||
option(STDC_WANT_SECURE_LIB "Use MSVC safe functions" ON)
|
||||
if(STDC_WANT_SECURE_LIB)
|
||||
ADD_DEFINITIONS(-DSTDC_WANT_SECURE_LIB)
|
||||
endif(STDC_WANT_SECURE_LIB)
|
||||
elseif (IAR)
|
||||
set(CPP_PLATFORM Iar)
|
||||
unset(CMAKE_CXX_EXTENSION_COMPILE_OPTION)
|
||||
set(TESTS_BUILD_DISCOVER OFF)
|
||||
# Set up the CMake variables for the linker
|
||||
set(LINKER_SCRIPT "${CppUTestRootDirectory}/platforms/iar/CppUTestTest.icf")
|
||||
set(CMAKE_C_LINK_FLAGS "--semihosting --config ${LINKER_SCRIPT} --map mapfile.map")
|
||||
set(CMAKE_CXX_LINK_FLAGS "--semihosting --config ${LINKER_SCRIPT} --map mapfile.map")
|
||||
elseif (STD_C)
|
||||
if(NOT CPP_PLATFORM)
|
||||
set(CPP_PLATFORM Gcc)
|
||||
endif(NOT CPP_PLATFORM)
|
||||
else (MSVC)
|
||||
set(STD_CPP False)
|
||||
set(MEMORY_LEAK_DETECTION False)
|
||||
set(CPPUTEST_CXX_FLAGS "${CPPUTEST_CXX_FLAGS} -nostdinc")
|
||||
set(CPPUTEST_LD_FLAGS "${CPPUTEST_LD_FLAGS} -nostdinc")
|
||||
set(CPPUTEST_STD_C_LIB_DISABLED 1)
|
||||
set(CPP_PLATFORM GccNoStdC)
|
||||
endif (MSVC)
|
||||
|
||||
include("${CppUTestRootDirectory}/cmake/Modules/CppUTestWarningFlags.cmake")
|
||||
|
||||
if (NOT STD_CPP)
|
||||
set(CPPUTEST_STD_CPP_LIB_DISABLED 1)
|
||||
if (STD_C AND NOT MSVC)
|
||||
set(CPPUTEST_CXX_FLAGS "${CPPUTEST_CXX_FLAGS} -nostdinc++")
|
||||
endif (STD_C AND NOT MSVC)
|
||||
endif (NOT STD_CPP)
|
||||
|
||||
if (MEMORY_LEAK_DETECTION)
|
||||
if (MSVC)
|
||||
set(CPPUTEST_C_FLAGS "${CPPUTEST_C_FLAGS} /FI \"${CppUTestRootDirectory}/include/CppUTest/MemoryLeakDetectorMallocMacros.h\"")
|
||||
set(CPPUTEST_CXX_FLAGS "${CPPUTEST_CXX_FLAGS} /FI \"${CppUTestRootDirectory}/include/CppUTest/MemoryLeakDetectorMallocMacros.h\"")
|
||||
elseif (IAR)
|
||||
set(CPPUTEST_C_FLAGS "${CPPUTEST_C_FLAGS} --preinclude \"${CppUTestRootDirectory}/include/CppUTest/MemoryLeakDetectorMallocMacros.h\"")
|
||||
set(CPPUTEST_CXX_FLAGS "${CPPUTEST_CXX_FLAGS} --preinclude \"${CppUTestRootDirectory}/include/CppUTest/MemoryLeakDetectorNewMacros.h\"")
|
||||
set(CPPUTEST_CXX_FLAGS "${CPPUTEST_CXX_FLAGS} --preinclude \"${CppUTestRootDirectory}/include/CppUTest/MemoryLeakDetectorMallocMacros.h\"")
|
||||
else (MSVC)
|
||||
set(CPPUTEST_C_FLAGS "${CPPUTEST_C_FLAGS} -include \"${CppUTestRootDirectory}/include/CppUTest/MemoryLeakDetectorMallocMacros.h\"")
|
||||
set(CPPUTEST_CXX_FLAGS "${CPPUTEST_CXX_FLAGS} -include \"${CppUTestRootDirectory}/include/CppUTest/MemoryLeakDetectorNewMacros.h\"")
|
||||
set(CPPUTEST_CXX_FLAGS "${CPPUTEST_CXX_FLAGS} -include \"${CppUTestRootDirectory}/include/CppUTest/MemoryLeakDetectorMallocMacros.h\"")
|
||||
endif (MSVC)
|
||||
else (MEMORY_LEAK_DETECTION)
|
||||
set(CPPUTEST_MEM_LEAK_DETECTION_DISABLED 1)
|
||||
endif (MEMORY_LEAK_DETECTION)
|
||||
|
||||
if (LONGLONG)
|
||||
set(CPPUTEST_USE_LONG_LONG 1)
|
||||
endif (LONGLONG)
|
||||
|
||||
if (MAP_FILE AND NOT MSVC)
|
||||
set(CPPUTEST_LD_FLAGS "${CPPUTEST_LD_FLAGS} -Wl,-Map,$<.map.txt")
|
||||
endif (MAP_FILE AND NOT MSVC)
|
||||
|
||||
if (COVERAGE AND NOT MSVC)
|
||||
set(CPPUTEST_C_FLAGS "${CPPUTEST_C_FLAGS} --coverage")
|
||||
set(CPPUTEST_CXX_FLAGS "${CPPUTEST_CXX_FLAGS} --coverage")
|
||||
set(CMAKE_BUILD_TYPE "Debug")
|
||||
find_program(GCOVR gcovr DOC "gcovr executable")
|
||||
|
||||
if (NOT GCOVR)
|
||||
message(SEND_ERROR "gcovr not found")
|
||||
endif()
|
||||
|
||||
add_custom_target(coverage ${GCOVR}
|
||||
--root ${PROJECT_SOURCE_DIR}
|
||||
--output "${CMAKE_BINARY_DIR}/coverage/coverage.html"
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
COMMENT "Generate coverage data"
|
||||
VERBATIM
|
||||
)
|
||||
endif()
|
||||
|
||||
if (CMAKE_CXX_STANDARD)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
elseif (C++11)
|
||||
find_package(CXX11 REQUIRED)
|
||||
set(CPPUTEST_CXX_FLAGS "${CPPUTEST_CXX_FLAGS} ${CXX11_FLAGS}")
|
||||
else()
|
||||
# No standard specified
|
||||
endif ()
|
||||
|
||||
set(GMOCK_HOME $ENV{GMOCK_HOME})
|
||||
if (DEFINED ENV{GMOCK_HOME})
|
||||
# GMock pulls in gtest.
|
||||
set(CPPUTEST_INCLUDE_GTEST_TESTS 1)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGTEST_USE_OWN_TR1_TUPLE=1")
|
||||
include_directories(${GMOCK_HOME}/include ${GMOCK_HOME}/gtest ${GMOCK_HOME}/gtest/include)
|
||||
add_subdirectory(${GMOCK_HOME} "${CMAKE_CURRENT_BINARY_DIR}/gmock")
|
||||
|
||||
set(CPPUTEST_C_WARNING_FLAGS "")
|
||||
set(CPPUTEST_CXX_WARNING_FLAGS "")
|
||||
endif (DEFINED ENV{GMOCK_HOME})
|
||||
|
||||
set(CPPUTEST_C_FLAGS "${CPPUTEST_C_FLAGS} ${CPPUTEST_C_WARNING_FLAGS}")
|
||||
set(CPPUTEST_CXX_FLAGS "${CPPUTEST_CXX_FLAGS} ${CPPUTEST_CXX_WARNING_FLAGS}")
|
||||
|
||||
if (CPPUTEST_FLAGS)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CPPUTEST_C_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CPPUTEST_CXX_FLAGS}")
|
||||
set(CMAKE_LD_FLAGS "${CMAKE_LD_FLAGS} ${CPPUTEST_LD_FLAGS}")
|
||||
endif (CPPUTEST_FLAGS)
|
|
@ -0,0 +1,10 @@
|
|||
# Override output properties to put test executable at specificied location
|
||||
function (cpputest_normalize_test_output_location TEST_TARGET)
|
||||
set_target_properties(${TEST_TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||
foreach(OUTPUT_CONFIG ${CMAKE_CONFIGURATION_TYPES})
|
||||
string(TOUPPER ${OUTPUT_CONFIG} OUTPUT_CONFIG)
|
||||
set_target_properties(${TEST_TARGET} PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY_${OUTPUT_CONFIG} ${CMAKE_CURRENT_BINARY_DIR})
|
||||
endforeach(OUTPUT_CONFIG)
|
||||
endfunction ()
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
if (MSVC)
|
||||
set(CPPUTEST_C_WARNING_FLAGS "/WX")
|
||||
set(CPPUTEST_CXX_WARNING_FLAGS "/WX /wd4290")
|
||||
else (MSVC)
|
||||
include(CheckCCompilerFlag)
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
macro(check_and_append_c_warning_flags)
|
||||
foreach (flag ${ARGN})
|
||||
check_c_compiler_flag("-${flag}" WARNING_C_FLAG_${flag})
|
||||
if (WARNING_C_FLAG_${flag})
|
||||
set(CPPUTEST_C_WARNING_FLAGS "${CPPUTEST_C_WARNING_FLAGS} -${flag}")
|
||||
endif (WARNING_C_FLAG_${flag})
|
||||
endforeach (flag)
|
||||
endmacro(check_and_append_c_warning_flags)
|
||||
|
||||
macro(check_and_append_cxx_warning_flags)
|
||||
foreach (flag ${ARGN})
|
||||
string(REPLACE "++" "xx" WARNING_CXX_FLAG_VAR "WARNING_CXX_FLAG_${flag}")
|
||||
check_cxx_compiler_flag("-${flag}" ${WARNING_CXX_FLAG_VAR})
|
||||
if (${WARNING_CXX_FLAG_VAR})
|
||||
set(CPPUTEST_CXX_WARNING_FLAGS "${CPPUTEST_CXX_WARNING_FLAGS} -${flag}")
|
||||
endif (${WARNING_CXX_FLAG_VAR})
|
||||
endforeach (flag)
|
||||
endmacro(check_and_append_cxx_warning_flags)
|
||||
|
||||
if (NOT GMOCK AND NOT REAL_GTEST)
|
||||
list(APPEND WARNING_C_FLAGS Werror pedantic-errors)
|
||||
endif (NOT GMOCK AND NOT REAL_GTEST)
|
||||
|
||||
set(WARNING_C_FLAGS
|
||||
Weverything
|
||||
Wall
|
||||
Wextra
|
||||
pedantic
|
||||
Wshadow
|
||||
Wswitch-default
|
||||
Wswitch-enum
|
||||
Wconversion
|
||||
Wsign-conversion
|
||||
Wno-padded
|
||||
Wno-disabled-macro-expansion
|
||||
Wno-reserved-id-macro
|
||||
Wno-keyword-macro
|
||||
Wno-long-long
|
||||
)
|
||||
|
||||
if (WERROR)
|
||||
list(APPEND WARNING_C_FLAGS Werror)
|
||||
endif (WERROR)
|
||||
|
||||
|
||||
set(WARNING_C_ONLY_FLAGS
|
||||
Wstrict-prototypes
|
||||
)
|
||||
|
||||
set(WARNING_CXX_FLAGS
|
||||
${WARNING_C_FLAGS}
|
||||
Woverloaded-virtual
|
||||
Wno-global-constructors
|
||||
Wno-exit-time-destructors
|
||||
Wno-weak-vtables
|
||||
Wno-old-style-cast
|
||||
)
|
||||
|
||||
if (C++11 OR (DEFINED CMAKE_CXX_STANDARD AND NOT CMAKE_CXX_STANDARD EQUAL 98))
|
||||
set(WARNING_CXX_FLAGS
|
||||
${WARNING_CXX_FLAGS}
|
||||
Wno-c++98-compat
|
||||
Wno-c++98-compat-pedantic
|
||||
Wno-c++14-compat
|
||||
Wno-inconsistent-missing-destructor-override
|
||||
)
|
||||
endif ()
|
||||
|
||||
check_and_append_c_warning_flags(${WARNING_C_FLAGS})
|
||||
check_and_append_c_warning_flags(${WARNING_C_ONLY_FLAGS})
|
||||
check_and_append_cxx_warning_flags(${WARNING_CXX_FLAGS})
|
||||
|
||||
endif (MSVC)
|
|
@ -0,0 +1,54 @@
|
|||
# - Finds if the compiler has C++11 support
|
||||
# This module can be used to detect compiler flags for using C++11, and checks
|
||||
# a small subset of the language.
|
||||
#
|
||||
# The following variables are set:
|
||||
# CXX11_FLAGS - flags to add to the CXX compiler for C++11 support
|
||||
# CXX11_FOUND - true if the compiler supports C++11
|
||||
#
|
||||
# TODO: When compilers starts implementing the whole C++11, check the full set
|
||||
|
||||
include(CheckCXXSourceCompiles)
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
set(CXX11_FLAG_CANDIDATES
|
||||
# Eveerything that automatically accepts C++11
|
||||
" "
|
||||
# gcc, clang and Intel Linux
|
||||
"-std=c++11"
|
||||
# Intel windows
|
||||
"/Qstd=c++0x"
|
||||
"/Qstd=c++11"
|
||||
)
|
||||
|
||||
set(CXX11_TEST_SOURCE
|
||||
"
|
||||
#if defined(_MSC_VER)
|
||||
#if _MSC_VER < 1800
|
||||
#error \"Can not compile with C++11\"
|
||||
#endif
|
||||
#elif __cplusplus < 201103L
|
||||
#error \"Can not compile with C++11\"
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{}
|
||||
")
|
||||
|
||||
foreach(FLAG ${CXX11_FLAG_CANDIDATES})
|
||||
set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
|
||||
set(CMAKE_REQUIRED_FLAGS "${FLAG}")
|
||||
unset(CXX11_FLAG_DETECTED CACHE)
|
||||
message(STATUS "Try C++11 flag = [${FLAG}]")
|
||||
check_cxx_source_compiles("${CXX11_TEST_SOURCE}" CXX11_FLAG_DETECTED)
|
||||
set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
|
||||
if(CXX11_FLAG_DETECTED)
|
||||
set(CXX11_FLAGS_INTERNAL "${FLAG}")
|
||||
break()
|
||||
endif(CXX11_FLAG_DETECTED)
|
||||
endforeach(FLAG ${CXX11_FLAG_CANDIDATES})
|
||||
|
||||
set(CXX11_FLAGS "${CXX11_FLAGS_INTERNAL}")
|
||||
|
||||
find_package_handle_standard_args(CXX11 DEFAULT_MSG CXX11_FLAGS)
|
||||
mark_as_advanced(CXX11_FLAGS)
|
|
@ -0,0 +1,94 @@
|
|||
# Create CTest entries for EXECUTABLE in CTestTestfile.cmake
|
||||
# Overwrite CTestTestfile.cmake with update version.
|
||||
|
||||
# Usage:
|
||||
#
|
||||
# This script is to be called from ../Modules/CppUTestBuildTimeDiscoverTests.cmake
|
||||
#
|
||||
# Notes on invocation and used variables:
|
||||
# ${CMAKE_COMMAND} -DTESTS_DETAILED:BOOL=<ON|OFF> -DEXECUTABLE=<FULLPATH-TO-EXECUTABLE> -P <PATH-TO-THIS-SCRIPT>
|
||||
#
|
||||
# TESTS_DETAILED c.f. top-level CMakeLists.txt
|
||||
# FULLPATH-TO-EXECUTABLE - use $<TARGET_FILE:${EXECUTABLE}> or explicit
|
||||
# The overwritten CTestTestfile.cmake is located in ${CMAKE_CURRENT_BINARY_DIR}
|
||||
#
|
||||
# Steps to generate ADD_TEST() commands build time
|
||||
# - Read CTestTestfile.cmake
|
||||
# - Create update entries
|
||||
# - Remove duplicate entries
|
||||
# - Write new CTestTestfile.cmake
|
||||
|
||||
######################################################################
|
||||
# helpers
|
||||
######################################################################
|
||||
function (buildtime_add_test)
|
||||
# Create ADD_TEST() command string
|
||||
# - Extract and remove testname from ARGV
|
||||
# - Add inner quotes to test arguments
|
||||
# - Add "ADD_TEST()", and first and last quote
|
||||
# Append result to CTESTTESTS
|
||||
list(GET ARGV 0 testname)
|
||||
list(REMOVE_AT ARGV 0)
|
||||
string (REPLACE ";" "\" \"" TEST_ARGS "${ARGV}")
|
||||
set(test_to_add "ADD_TEST(${testname} \"${TEST_ARGS}\")")
|
||||
list(APPEND CTESTTESTS ${test_to_add})
|
||||
SET(CTESTTESTS ${CTESTTESTS} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function (JOIN VALUES GLUE OUTPUT)
|
||||
string (REPLACE ";" "${GLUE}" _TMP_STR "${VALUES}")
|
||||
set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function (buildtime_discover_tests EXECUTABLE DISCOVER_ARG OUTPUT)
|
||||
execute_process(COMMAND ${EXECUTABLE} ${DISCOVER_ARG}
|
||||
OUTPUT_VARIABLE _TMP_OUTPUT
|
||||
ERROR_VARIABLE DISCOVER_ERR
|
||||
RESULT_VARIABLE DISCOVER_ERR)
|
||||
if(NOT ${DISCOVER_ERR} EQUAL 0)
|
||||
message(SEND_ERROR "Executable \"${EXECUTABLE} ${DISCOVER_ARG}\" failed with output:\n"
|
||||
"${DISCOVER_ERR}\n"
|
||||
"Please check that the excutable was added.")
|
||||
endif(NOT ${DISCOVER_ERR} EQUAL 0)
|
||||
separate_arguments(_TMP_OUTPUT)
|
||||
set(${OUTPUT} "${_TMP_OUTPUT}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
|
||||
######################################################################
|
||||
# Implementation
|
||||
######################################################################
|
||||
|
||||
set(CTESTFNAME "${CMAKE_CURRENT_BINARY_DIR}/CTestTestfile.cmake")
|
||||
file(STRINGS ${CTESTFNAME} CTESTTESTS)
|
||||
get_filename_component(EXECUTABLE_SHORT_NAME ${EXECUTABLE} NAME_WE)
|
||||
|
||||
if (TESTS_DETAILED)
|
||||
set(DISCOVER_ARG "-ln")
|
||||
buildtime_discover_tests("${EXECUTABLE}" "${DISCOVER_ARG}" TestList_GroupsAndNames)
|
||||
set(lastgroup "")
|
||||
foreach(testfullname ${TestList_GroupsAndNames})
|
||||
string(REGEX MATCH "^([^/.]+)" groupname ${testfullname})
|
||||
string(REGEX MATCH "([^/.]+)$" testname ${testfullname})
|
||||
if (NOT ("${groupname}" STREQUAL "${lastgroup}"))
|
||||
message("TestGroup: ${groupname}:")
|
||||
set(lastgroup "${groupname}")
|
||||
endif (NOT ("${groupname}" STREQUAL "${lastgroup}"))
|
||||
message("... ${testname}")
|
||||
buildtime_add_test(${EXECUTABLE_SHORT_NAME}.${testfullname} ${EXECUTABLE} -sg ${groupname} -sn ${testname})
|
||||
endforeach()
|
||||
else (TESTS_DETAILED)
|
||||
set(DISCOVER_ARG "-lg")
|
||||
buildtime_discover_tests("${EXECUTABLE}" "${DISCOVER_ARG}" TestList_Groups)
|
||||
foreach(group ${TestList_Groups})
|
||||
message("TestGroup: ${group}")
|
||||
buildtime_add_test(${EXECUTABLE_SHORT_NAME}.${group} "${EXECUTABLE}" -sg ${group})
|
||||
endforeach()
|
||||
endif (TESTS_DETAILED)
|
||||
|
||||
|
||||
# create separate CTest test for each CppUTestTests test
|
||||
|
||||
list(REMOVE_DUPLICATES CTESTTESTS)
|
||||
JOIN("${CTESTTESTS}" "\n" CTESTTESTS)
|
||||
file(WRITE ${CTESTFNAME} "${CTESTTESTS}\n")
|
|
@ -0,0 +1,6 @@
|
|||
# Toolchain to use Clang compiler with MinGW binutils (e.g. linker) in Windows to generate 32-bits executables
|
||||
|
||||
set(CMAKE_C_COMPILER clang)
|
||||
set(CMAKE_C_FLAGS "-target i686-w64-mingw32 -m32" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_COMPILER clang++)
|
||||
set(CMAKE_CXX_FLAGS "-target i686-w64-mingw32 -m32" CACHE STRING "" FORCE)
|
|
@ -0,0 +1,6 @@
|
|||
# Toolchain to use Clang compiler with MinGW binutils (e.g. linker) in Windows to generate 64-bits executables
|
||||
|
||||
set(CMAKE_C_COMPILER clang)
|
||||
set(CMAKE_C_FLAGS "-target x86_64-w64-mingw32" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_COMPILER clang++)
|
||||
set(CMAKE_CXX_FLAGS "-target x86_64-w64-mingw32" CACHE STRING "" FORCE)
|
|
@ -0,0 +1,24 @@
|
|||
### BEGIN CMAKE_TOOLCHAIN_FILE
|
||||
# "Generic" is used when cross compiling
|
||||
set(CMAKE_SYSTEM_NAME Generic)
|
||||
|
||||
# Set the EW installation root directory
|
||||
#(Avoid spaces in the path or you need to escape them)
|
||||
set(EW_ROOT_DIR "/opt/iarsystems/bxarm/arm/")
|
||||
|
||||
# Compiler flags needed to compile for this CPU
|
||||
set(CPU_FLAGS "--cpu Cortex-M4F")
|
||||
|
||||
# Set up the CMake variables for compiler and assembler
|
||||
# (The reason for both C and CXX variables is that CMake
|
||||
# treats C and C++ tools individually)
|
||||
set(CMAKE_C_COMPILER "${EW_ROOT_DIR}/bin/iccarm" "${CPU_FLAGS} --dlib_config normal")
|
||||
set(CMAKE_CXX_COMPILER "${EW_ROOT_DIR}/bin/iccarm" "${CPU_FLAGS} --dlib_config normal")
|
||||
set(CMAKE_ASM_COMPILER "${EW_ROOT_DIR}/bin/iasmarm" "${CPU_FLAGS}")
|
||||
|
||||
# For CppUTest, set the IAR variable
|
||||
set(IAR True)
|
||||
|
||||
# Build with cmake -H. -Bbuild -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=cmake/ewarm-linux.toolchain.cmake
|
||||
|
||||
### END CMAKE_TOOLCHAIN_FILE
|
|
@ -0,0 +1,24 @@
|
|||
### BEGIN CMAKE_TOOLCHAIN_FILE
|
||||
# "Generic" is used when cross compiling
|
||||
set(CMAKE_SYSTEM_NAME Generic)
|
||||
|
||||
# Set the EW installation root directory
|
||||
#(Avoid spaces in the path or you need to escape them)
|
||||
set(EW_ROOT_DIR "E:/Program Files\ (x86)/IAR\ Systems/Embedded\ Workbench\ Arm 8.50.6/arm")
|
||||
|
||||
# Compiler flags needed to compile for this CPU
|
||||
set(CPU_FLAGS "--cpu Cortex-M4F")
|
||||
|
||||
# Set up the CMake variables for compiler and assembler
|
||||
# (The reason for both C and CXX variables is that CMake
|
||||
# treats C and C++ tools individually)
|
||||
set(CMAKE_C_COMPILER "${EW_ROOT_DIR}/bin/iccarm.exe" "${CPU_FLAGS} --dlib_config normal")
|
||||
set(CMAKE_CXX_COMPILER "${EW_ROOT_DIR}/bin/iccarm.exe" "${CPU_FLAGS} --dlib_config normal")
|
||||
set(CMAKE_ASM_COMPILER "${EW_ROOT_DIR}/bin/iasmarm.exe" "${CPU_FLAGS}")
|
||||
|
||||
# For CppUTest, set the IAR variable
|
||||
set(IAR True)
|
||||
|
||||
# Build with cmake -H. -Bbuild -G "NMake Makefiles" -DCMAKE_TOOLCHAIN_FILE=cmake/ewarm-win.toolchain.cmake
|
||||
|
||||
### END CMAKE_TOOLCHAIN_FILE
|
Loading…
Add table
Add a link
Reference in a new issue