Skip to content

Commit

Permalink
Windows build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
luboslenco committed Jul 31, 2024
1 parent 6cdfa46 commit 1901a2f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
3 changes: 2 additions & 1 deletion sources/krom.h
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,7 @@ void krom_init(string_t *title, i32 width, i32 height, bool vsync, i32 window_mo
frame.color_bits = 32;
frame.depth_bits = 0;
frame.stencil_bits = 0;
frame.samples_per_pixel = 1;
kinc_init(title, win.width, win.height, &win, &frame);
kinc_random_init((int)(kinc_time() * 1000));

Expand Down Expand Up @@ -1132,7 +1133,7 @@ kinc_g4_shader_t *krom_g4_create_vertex_shader_from_source(string_t *source) {
bool hasPos = strstr(temp_string_vs, "pos :") != NULL;
bool hasTex = strstr(temp_string_vs, "tex :") != NULL;

i32_map_t *attributes = calloc(sizeof(i32_map_t), 1);
i32_map_t *attributes = i32_map_create();
int index = 0;
if (hasBone) i32_map_set(attributes, "bone", index++);
if (hasCol) i32_map_set(attributes, "col", index++);
Expand Down
27 changes: 15 additions & 12 deletions tools/make.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,11 +345,12 @@ class Exporter {
}

nice_path(from, to, filepath) {
let absolute = path_normalize(filepath);
if (!path_isabs(absolute)) {
absolute = path_resolve(from, filepath);
}
return path_relative(to, absolute);
return filepath;
// let absolute = path_normalize(filepath);
// if (!path_isabs(absolute)) {
// absolute = path_resolve(from, filepath);
// }
// return path_relative(to, absolute);
}
}

Expand Down Expand Up @@ -794,11 +795,12 @@ class VisualStudioExporter extends Exporter {
let incstring = "";
let includedirs = project.getIncludeDirs();
for (let include of includedirs) {
let relativized = path_relative(to, path_resolve(from, include));
if (relativized === "") {
relativized = ".";
}
incstring += relativized + ";";
// let relativized = path_relative(to, path_resolve(from, include));
// if (relativized === "") {
// relativized = ".";
// }
// incstring += relativized + ";";
incstring += include + ";";
}
if (incstring.length > 0)
incstring = incstring.substr(0, incstring.length - 1);
Expand Down Expand Up @@ -3350,8 +3352,9 @@ function main() {
make = os_exec('xcodebuild', xcode_options, { cwd: "build" });
}
else if (goptions.target == 'windows') {
let vswhere = path_join(os_env('ProgramFiles(x86)'), 'Microsoft Visual Studio', 'Installer', 'vswhere.exe');
let vsvars = os_exec(vswhere, ['-products', '*', '-latest', '-find', 'VC\\Auxiliary\\Build\\vcvars64.bat']).stdout.trim();
// let vswhere = path_join(os_env('ProgramFiles(x86)'), 'Microsoft Visual Studio', 'Installer', 'vswhere.exe');
// let vsvars = os_exec(vswhere, ['-products', '*', '-latest', '-find', 'VC\\Auxiliary\\Build\\vcvars64.bat']).trim();
let vsvars = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat";
fs_writefile(path_join("build", 'build.bat'), '@call "' + vsvars + '"\n' + '@MSBuild.exe "' + path_resolve("build", project_name + '.vcxproj') + '" /m /clp:ErrorsOnly /p:Configuration=' + (goptions.debug ? 'Debug' : 'Release') + ',Platform=x64');
make = os_exec('build.bat', [], { cwd: "build" });
}
Expand Down

0 comments on commit 1901a2f

Please sign in to comment.