Browse Source

Relative #include directories are resolve to be relative to the directory in which the build executes

default_compile_flags
vector-of-bool 4 years ago
parent
commit
fa81bff674
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      src/dds/build/plan/compile_file.cpp

+ 7
- 1
src/dds/build/plan/compile_file.cpp View File

compile_command_info compile_file_plan::generate_compile_command(build_env_ref env) const { compile_command_info compile_file_plan::generate_compile_command(build_env_ref env) const {
compile_file_spec spec{_source.path, calc_object_file_path(env)}; compile_file_spec spec{_source.path, calc_object_file_path(env)};
spec.enable_warnings = _rules.enable_warnings(); spec.enable_warnings = _rules.enable_warnings();
extend(spec.include_dirs, _rules.include_dirs());
for (auto dirpath : _rules.include_dirs()) {
if (!dirpath.is_absolute()) {
dirpath = env.output_root / dirpath;
}
dirpath = fs::weakly_canonical(dirpath);
spec.include_dirs.push_back(std::move(dirpath));
}
for (const auto& use : _rules.uses()) { for (const auto& use : _rules.uses()) {
extend(spec.external_include_dirs, env.ureqs.include_paths(use)); extend(spec.external_include_dirs, env.ureqs.include_paths(use));
} }

Loading…
Cancel
Save