Skip to content

Commit

Permalink
[k2] fix runtime compilation from sources (#1222)
Browse files Browse the repository at this point in the history
  • Loading branch information
astrophysik authored Jan 22, 2025
1 parent c2d7b38 commit e6b0ac8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion compiler/make/make.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,8 @@ static std::string get_light_runtime_compiler_options() {
}

static std::vector<File *> build_runtime_and_common_from_sources(const std::string &compiler_flags, MakeSetup &make, Index &obj_dir) {
const std::unordered_map<std::string_view, std::string_view> specific_flags_for_files =
{{"stdlib/vkext/string-processing.cpp", " -Wno-invalid-source-encoding"}};
const Index &runtime_core_dir = G->get_runtime_core_index();
const Index &runtime_dir = G->get_runtime_index();
const Index &common_dir = G->get_common_index();
Expand All @@ -480,7 +482,11 @@ static std::vector<File *> build_runtime_and_common_from_sources(const std::stri
files_hashes.insert(vk::std_hash(obj_name));
File *obj_file = obj_dir.insert_file(std::move(obj_name));
make.create_cpp_target(cpp_file);
make.create_runtime_src2obj_target(cpp_file, obj_file, compiler_flags);
if (auto it = specific_flags_for_files.find(cpp_file->name); it != specific_flags_for_files.end()) {
make.create_runtime_src2obj_target(cpp_file, obj_file, compiler_flags + std::string(it->second));
} else {
make.create_runtime_src2obj_target(cpp_file, obj_file, compiler_flags);
}
objs.push_back(obj_file);
}
}
Expand Down

0 comments on commit e6b0ac8

Please sign in to comment.