CMakeLists for each C file

This commit is contained in:
2021-12-07 07:28:47 -08:00
parent f333cc47fa
commit c75bce4d93
32 changed files with 321 additions and 38 deletions

View File

@ -24,6 +24,10 @@ target_link_libraries(texture_generation
PUBLIC
stb
)
target_link_libraries(texture_generation
PRIVATE
${LIBS_PLATFORM}
)
# Function for creating the target
function(tool_texture target in out)

View File

@ -5,7 +5,8 @@
function(tool_assets args)
add_custom_target(assets
COMMAND tar -C ${ASSETS_BUILD_DIR} -czvf assets.tar.gz *
# COMMAND tar -C ${ASSETS_BUILD_DIR} -czvf assets.tar.gz *
COMMAND echo ${ASSETS_BUILD_DIR}
DEPENDS ${ARGV}
COMMENT "Compressing Assets"
)

View File

@ -5,12 +5,8 @@ function(tool_game name version)
)
file(WRITE ${TEMP_DIR}/dawn/game/game.h
"#include \"games/${TARGET_GAME}/game.h\""
"#pragma once\n#include <games/${TARGET_GAME}/game.h>"
)
# target_sources(${PROJECT_NAME}
# PRIVATE
# ${TEMP_DIR}/dawn/game/game.h
# )
target_include_directories(${PROJECT_NAME} PUBLIC ${TEMP_DIR}/dawn)
endfunction()

View File

@ -29,7 +29,7 @@ void fileMkdirp(char *path) {
while(c = path[i]) {
if((c == '\\' || c == '/') && i > 0) {
buffer[i] = '\0';
_mkdir(buffer);
fileMkdir(buffer, 0755);
inFile = false;
hasMore = false;
buffer[i] = FILE_PATH_SEP;
@ -45,7 +45,7 @@ void fileMkdirp(char *path) {
if(!inFile && hasMore) {
buffer[i] = '\0';
_mkdir(buffer);
fileMkdir(buffer, 0755);
}
}
@ -117,5 +117,32 @@ bool fileListChildren(
*count = i;
return true;
#else
struct dirent *de;
DIR *dr;
int32_t i;
// Open Dir
dr = opendir(directory);
if(dr == NULL) {
printf("Could not open directory");
return false;
}
// Iterate
i = 0;
while ((de = readdir(dr)) != NULL) {
// File or folder?
if(de->d_type != DT_REG) continue;
// Copy into child buffer
children[i] = buffer + (i * FILE_CHILD_NAME_MAX);
strcpy(children[i], de->d_name);
i++;
}
if(closedir(dr)) return false;
*count = i;
return true;
#endif
}

View File

@ -18,9 +18,13 @@
#include <windows.h>
#define getcwd _getcwd
#define FILE_PATH_SEP '\\'
#define fileMkdir(path, perms) _mkdir(path)
#elif defined(__GNUC__)
#include <unistd.h>
#include <dirent.h>
#include <sys/stat.h>
#define FILE_PATH_SEP '/'
#define fileMkdir(path, perms) mkdir(path, perms)
#endif
void fileNormalizeSlashes(char *string);

View File

@ -25,6 +25,10 @@ target_link_libraries(character_generator
PUBLIC
stb
)
target_link_libraries(character_generator
PRIVATE
${LIBS_PLATFORM}
)
# Function Target
function(tool_vn_character target in out)