mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-20 12:32:18 +08:00
feat(CI): Windows MSVC and GCC build (#6015)
This commit is contained in:
+16
-10
@@ -13,16 +13,23 @@
|
||||
*********************/
|
||||
#if LV_BUILD_TEST
|
||||
#include "../lvgl.h"
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#include "unity.h"
|
||||
#define PNG_DEBUG 3
|
||||
#include <png.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <direct.h>
|
||||
#define mkdir(pathname, mode) _mkdir(pathname)
|
||||
#define strtok_r strtok_s
|
||||
#else
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
@@ -429,21 +436,20 @@ static void create_folders_if_needed(const char * path)
|
||||
|
||||
char * token = strtok_r(pathCopy, "/", &ptr);
|
||||
char current_path[1024] = {'\0'}; // Adjust the size as needed
|
||||
struct stat st;
|
||||
|
||||
while(token && ptr && *ptr != '\0') {
|
||||
strcat(current_path, token);
|
||||
strcat(current_path, "/");
|
||||
|
||||
if(stat(current_path, &st) != 0) {
|
||||
// Folder doesn't exist, create it
|
||||
if(mkdir(current_path, 0777) != 0) {
|
||||
perror("Error creating folder");
|
||||
free(pathCopy);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
int mkdir_retval = mkdir(current_path, 0777);
|
||||
if (mkdir_retval == 0) {
|
||||
printf("Created folder: %s\n", current_path);
|
||||
}
|
||||
else if (errno != EEXIST) {
|
||||
perror("Error creating folder");
|
||||
free(pathCopy);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
token = strtok_r(NULL, "/", &ptr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user