switch to cmake build

This commit is contained in:
2026-07-28 21:38:49 +02:00
parent 93b1701523
commit 18ad060fe7
2 changed files with 34 additions and 15 deletions
+34 -15
View File
@@ -1,4 +1,8 @@
using System; using System;
using System.IO;
using System.Collections;
using System.Diagnostics;
using CxxBuildTool; using CxxBuildTool;
namespace KTX; namespace KTX;
@@ -22,11 +26,37 @@ static
private static void Build() private static void Build()
{ {
if (!Compiler.IsBuilding) return; if (!Compiler.IsBuilding) return;
CxxBuildTool.CMake(Compiler.ProjectDir + "/KTX-Software/lib", Compiler.BuildDir + "/" + Compiler.ProjectName, "-D BUILD_SHARED_LIBS=OFF");
/*List<String> files = new .(64);
defer { DeleteContainerAndItems!(files); }
List<StringView> fileViews = scope .(64);
void Directory(StringView dir)
{
for (let file in Directory.EnumerateFiles(scope $"{Compiler.ProjectDir}/KTX-Software/{dir}"))
{
let filename = file.GetFileName(..scope .());
if (!filename.EndsWith(".c") && !filename.EndsWith(".cpp") && !filename.EndsWith(".cc") && !filename.EndsWith(".cxx"))
continue;
files.Add(new String(dir.Length + 1 + filename.Length)..Append(dir)..Append('/')..Append(filename));
fileViews.Add(files.Back);
}
}
Directory("lib/src");
Directory("external/astc-encoder/Source");
Directory("external/basis_universal/encoder");
Directory("external/basis_universal/zstd");
Directory("external/dfdutils");
Directory("external/fmt/src");
CxxBuildTool.Ninja( CxxBuildTool.Ninja(
Compiler.ProjectDir + "/KTX-Software/lib/src", Compiler.ProjectDir + "/KTX-Software/",
Compiler.BuildDir + "/" + Compiler.ProjectName, Compiler.BuildDir + "/" + Compiler.ProjectName,
"libktx", "libktx",
"-DKHRONOS_STATIC -I\"" + "-DKHRONOS_STATIC -Wno-everything -I\"" +
Compiler.ProjectDir + "/KTX-Software/lib/include\" -I\"" + Compiler.ProjectDir + "/KTX-Software/lib/include\" -I\"" +
Compiler.ProjectDir + "/KTX-Software/utils\" -I\"" + Compiler.ProjectDir + "/KTX-Software/utils\" -I\"" +
Compiler.ProjectDir + "/KTX-Software/other_include\" -I\"" + Compiler.ProjectDir + "/KTX-Software/other_include\" -I\"" +
@@ -35,19 +65,8 @@ static
Compiler.ProjectDir + "/KTX-Software/external/basis_universal/zstd\" -I\"" + Compiler.ProjectDir + "/KTX-Software/external/basis_universal/zstd\" -I\"" +
Compiler.ProjectDir + "/KTX-Software/external/dfdutils\" -I\"" + Compiler.ProjectDir + "/KTX-Software/external/dfdutils\" -I\"" +
Compiler.ProjectDir + "/src\"", Compiler.ProjectDir + "/src\"",
params fileViews
"astc_codec.cpp", );*/
"basis_transcode.cpp",
"miniz_wrapper.cpp",
"etcunpack.cxx",
"checkheader.c", "info.c", "texture2.c", "vkloader.c",
"filestream.c", "memstream.c", "vk_funcs.c", "writer1.c",
"gl_funcs.c", "strings.c", "vkformat_check.c", "writer2.c",
"glformat_str.c", "swap.c", "vkformat_check_variant.c",
"glloader.c", "texture.c", "vkformat_str.c",
"hashlist.c", "texture1.c", "vkformat_typesize.c"
);
} }
} }
View File