Committer:
leothedragon
Date:
Sun Apr 18 15:20:23 2021 +0000
Revision:
0:25fa8795676b
DS

Who changed what in which revision?

UserRevisionLine numberNew contents of line
leothedragon 0:25fa8795676b 1 INCLUDE(CMakeForceCompiler)
leothedragon 0:25fa8795676b 2 # CROSS COMPILER SETTING
leothedragon 0:25fa8795676b 3 cmake_minimum_required (VERSION 3.5)
leothedragon 0:25fa8795676b 4 SET(CMAKE_SYSTEM_NAME Generic)
leothedragon 0:25fa8795676b 5
leothedragon 0:25fa8795676b 6 project(mbedPal)
leothedragon 0:25fa8795676b 7
leothedragon 0:25fa8795676b 8 macro(SET_COMPILER_DBG_RLZ_FLAG flag value)
leothedragon 0:25fa8795676b 9 SET(${flag}_DEBUG "${${flag}_DEBUG} ${value}")
leothedragon 0:25fa8795676b 10 SET(${flag}_RELEASE "${${flag}_RELEASE} ${value}")
leothedragon 0:25fa8795676b 11
leothedragon 0:25fa8795676b 12 #enable this if for debugging
leothedragon 0:25fa8795676b 13 if (0)
leothedragon 0:25fa8795676b 14 message("flag = ${flag}")
leothedragon 0:25fa8795676b 15 message("value = ${value}")
leothedragon 0:25fa8795676b 16 message("MY_C_FLAGS_RELEASE2 = ${CMAKE_C_FLAGS_RELEASE}")
leothedragon 0:25fa8795676b 17 endif(0) # comment end
leothedragon 0:25fa8795676b 18
leothedragon 0:25fa8795676b 19 endmacro(SET_COMPILER_DBG_RLZ_FLAG)
leothedragon 0:25fa8795676b 20
leothedragon 0:25fa8795676b 21 if(DISALLOW_WARNINGS)
leothedragon 0:25fa8795676b 22 if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
leothedragon 0:25fa8795676b 23 SET_COMPILER_DBG_RLZ_FLAG (CMAKE_C_FLAGS "-Werror")
leothedragon 0:25fa8795676b 24 SET_COMPILER_DBG_RLZ_FLAG (CMAKE_CXX_FLAGS "-Werror")
leothedragon 0:25fa8795676b 25 endif()
leothedragon 0:25fa8795676b 26 endif()
leothedragon 0:25fa8795676b 27
leothedragon 0:25fa8795676b 28 if ((${OS_BRAND} MATCHES "Linux"))
leothedragon 0:25fa8795676b 29 add_definitions(-DPAL_LINUX)
leothedragon 0:25fa8795676b 30 endif()
leothedragon 0:25fa8795676b 31
leothedragon 0:25fa8795676b 32 MACRO(HEADER_DIRECTORIES return_list)
leothedragon 0:25fa8795676b 33 FILE(GLOB_RECURSE new_list ${CMAKE_CURRENT_SOURCE_DIR}/Configs/pal_config/${OS_BRAND}/*.h)
leothedragon 0:25fa8795676b 34 SET(dir_list "")
leothedragon 0:25fa8795676b 35 FOREACH(file_path ${new_list})
leothedragon 0:25fa8795676b 36 GET_FILENAME_COMPONENT(dir_path ${file_path} PATH)
leothedragon 0:25fa8795676b 37 SET(dir_list ${dir_list} ${dir_path})
leothedragon 0:25fa8795676b 38 ENDFOREACH()
leothedragon 0:25fa8795676b 39 LIST(REMOVE_DUPLICATES dir_list)
leothedragon 0:25fa8795676b 40 SET(${return_list} ${dir_list})
leothedragon 0:25fa8795676b 41 ENDMACRO()
leothedragon 0:25fa8795676b 42
leothedragon 0:25fa8795676b 43 set(config_list "")
leothedragon 0:25fa8795676b 44 HEADER_DIRECTORIES(config_list)
leothedragon 0:25fa8795676b 45 foreach(config_dir ${config_list})
leothedragon 0:25fa8795676b 46 ADD_GLOBALDIR("${config_dir}")
leothedragon 0:25fa8795676b 47 endforeach()
leothedragon 0:25fa8795676b 48
leothedragon 0:25fa8795676b 49 ADD_GLOBALDIR(${CMAKE_CURRENT_SOURCE_DIR}/Configs/pal_config)
leothedragon 0:25fa8795676b 50
leothedragon 0:25fa8795676b 51 # add the binary tree to the search path for include files
leothedragon 0:25fa8795676b 52 ADDSUBDIRS()