Skip to content

Commit

Permalink
merge fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rpoisel committed Aug 15, 2016
2 parents 5ce4175 + 9130045 commit d35d2b7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
7 changes: 4 additions & 3 deletions arduino/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,18 @@ file(GLOB_RECURSE ARDUINO_SRC
${ARDUINO_ESP8266_DIR}/cores/esp8266/*.cpp
)

file(GLOB ARDUINO_ASM_SRC
file(GLOB ARDUINO_SRC_ASM
${ARDUINO_ESP8266_DIR}/cores/esp8266/*.S
)

set_source_files_properties(${ARDUINO_ASM_SRC} PROPERTIES
set_source_files_properties(${ARDUINO_SRC_ASM} PROPERTIES
LANGUAGE ASM
COMPILE_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_DEBUG}"
)

add_library(arduino STATIC
${ARDUINO_SRC}
${ARDUINO_ASM_SRC}
${ARDUINO_SRC_ASM}
)

target_include_directories(arduino PUBLIC
Expand Down
18 changes: 18 additions & 0 deletions arduino/libraries/GDBStub/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,18 @@ file(GLOB GDBSTUB_LIB_SRC
${ARDUINO_ESP8266_DIR}/libraries/GDBStub/src/internal/*.S
)

file(GLOB GDBSTUB_LIB_SRC_ASM
${ARDUINO_ESP8266_DIR}/libraries/GDBStub/src/internal/*.S
)

set_source_files_properties(${GDBSTUB_LIB_SRC_ASM} PROPERTIES
LANGUAGE ASM
COMPILE_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_DEBUG}"
)

add_library(esp8266gdbstub STATIC
${GDBSTUB_LIB_SRC}
${GDBSTUB_LIB_SRC_ASM}
)

target_include_directories(esp8266gdbstub PUBLIC
Expand All @@ -14,3 +24,11 @@ target_include_directories(esp8266gdbstub PUBLIC
${ARDUINO_ESP8266_DIR}/libraries/GDBStub/src/xtensa/config
)

target_compile_definitions(esp8266gdbstub PUBLIC
-DGDBSTUB_REDIRECT_CONSOLE_OUTPUT
-DGDBSTUB_CTRLC_BREAK
-DGDBSTUB_BREAK_ON_INIT
)

target_link_libraries(esp8266gdbstub
arduino
5 changes: 3 additions & 2 deletions cmake/toolchain.ESP8266.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ set(CMAKE_SYSTEM_VERSION 1)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/Modules")

set (ESP8266_FLASH_SIZE "512K" CACHE STRING "Size of flash")
set (ESP8266_FLASH_SIZE "512k0" CACHE STRING "Size of flash")
set (ESP8266_LINKER_SCRIPT "eagle.flash.512k0.ld" CACHE STRING "Name of linker script")

if(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux")
set(USER_HOME $ENV{HOME})
Expand Down Expand Up @@ -45,7 +46,7 @@ CMAKE_FORCE_CXX_COMPILER(${ESP8266_XTENSA_CXX_COMPILER} GNU_CXX)

set(CMAKE_C_FLAGS "-Os -g -std=gnu99 -Wpointer-arith -Wno-implicit-function-declaration -Wundef -pipe -D__ets__ -DICACHE_FLASH -fno-inline-functions -ffunction-sections -nostdlib -mlongcalls -mtext-section-literals -falign-functions=4 -fdata-sections" CACHE STRING "C compiler flags")
set(CMAKE_CXX_FLAGS "-Os -g -D__ets__ -DICACHE_FLASH -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -MMD -ffunction-sections -fdata-sections" CACHE STRING "CXX compiler flags")
set(CMAKE_EXE_LINKER_FLAGS "-nostdlib -Wl,--no-check-sections -Wl,-static -Wl,--gc-sections -Wl,--no-relax -L${ARDUINO_ESP8266_DIR}/tools/sdk/ld -Teagle.flash.512k0.ld -u call_user_start -Wl,-wrap,system_restart_local -Wl,-wrap,register_chipv6_phy" CACHE STRING "linker flags")
set(CMAKE_EXE_LINKER_FLAGS "-nostdlib -Wl,--no-check-sections -Wl,-static -Wl,--gc-sections -Wl,--no-relax -L${ARDUINO_ESP8266_DIR}/tools/sdk/ld -Teagle.flash.${ESP8266_FLASH_SIZE}.ld -u call_user_start -Wl,-wrap,system_restart_local -Wl,-wrap,register_chipv6_phy" CACHE STRING "linker flags")

set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> -o <TARGET> -Wl,--start-group <OBJECTS> <LINK_LIBRARIES> -Wl,--end-group" CACHE STRING "C linker invocation")
set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> -o <TARGET> -Wl,--start-group <OBJECTS> <LINK_LIBRARIES> -Wl,--end-group" CACHE STRING "CXX linker invocation")
Expand Down

0 comments on commit d35d2b7

Please sign in to comment.