mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-08 04:02:27 +00:00
cmake: fix C identifier generation from embedded file
This commit is contained in:
6
tools/test_apps/build_system/embed_test/CMakeLists.txt
Normal file
6
tools/test_apps/build_system/embed_test/CMakeLists.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
# The following lines of boilerplate have to be in your project's
|
||||
# CMakeLists in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(file_embed_test)
|
1
tools/test_apps/build_system/embed_test/README.txt
Normal file
1
tools/test_apps/build_system/embed_test/README.txt
Normal file
@@ -0,0 +1 @@
|
||||
This project tests that proper identifiers are generated during build for embedded files.
|
@@ -0,0 +1,4 @@
|
||||
idf_component_register(SRCS "test_main.c"
|
||||
INCLUDE_DIRS "."
|
||||
# Test file names starting with a number, a letter and an underscore.
|
||||
EMBED_TXTFILES "2file.txt" "file.txt" "_file.txt")
|
18
tools/test_apps/build_system/embed_test/main/test_main.c
Normal file
18
tools/test_apps/build_system/embed_test/main/test_main.c
Normal file
@@ -0,0 +1,18 @@
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
extern uint8_t _2file_start[] asm("_binary_2file_txt_start");
|
||||
extern uint8_t _2file_end[] asm("_binary_2file_txt_end");
|
||||
extern uint8_t file_start[] asm("_binary_file_txt_start");
|
||||
extern uint8_t file_end[] asm("_binary_file_txt_start");
|
||||
extern uint8_t _file_start[] asm("_binary__file_txt_start");
|
||||
extern uint8_t _file_end[] asm("_binary__file_txt_start");
|
||||
|
||||
#define PRINT_ADDR(f) printf("%s -> start: %p end:%p\n", #f, f ## _start, f ## _end);
|
||||
|
||||
void app_main(void)
|
||||
{
|
||||
PRINT_ADDR(_2file);
|
||||
PRINT_ADDR(file);
|
||||
PRINT_ADDR(_file);
|
||||
}
|
@@ -1,2 +1,4 @@
|
||||
idf_component_register(SRCS "test_main.c"
|
||||
INCLUDE_DIRS ".")
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user