Skip to content

Commit

Permalink
Smaller changes for MSVC compatibility. (#1355)
Browse files Browse the repository at this point in the history
- These fixes come from #1354, and should not be controversial.
- Generated sources are already split into dir, filename
  • Loading branch information
matz-e authored Jul 17, 2024
1 parent 8052b40 commit 4f47074
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/codegen/codegen_cpp_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1353,7 +1353,7 @@ void CodegenCppVisitor::setup(const Program& node) {
info.mod_file = mod_filename;

if (info.mod_suffix == "") {
info.mod_suffix = std::filesystem::path(mod_filename).stem();
info.mod_suffix = std::filesystem::path(mod_filename).stem().string();
}
info.rsuffix = info.point_process ? "" : "_" + info.mod_suffix;

Expand Down
2 changes: 1 addition & 1 deletion src/language/code_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def jinja_template(self, path):
Returns:
A jinja template object
"""
name = str(path.relative_to(self.jinja_templates_dir))
name = str(path.relative_to(self.jinja_templates_dir).as_posix())
return self.jinja_env.get_template(name)

def _cmake_deps_task(self, tasks):
Expand Down
6 changes: 3 additions & 3 deletions src/language/templates/code_generator.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
# cmake-format: off
set(CODE_GENERATOR_JINJA_FILES
{% for template in templates | sort %}
${PROJECT_SOURCE_DIR}/src/language/templates/{{ template }}
${PROJECT_SOURCE_DIR}/src/language/templates/{{ template.as_posix() }}
{% endfor %}
)

set(CODE_GENERATOR_PY_FILES
{% for file in py_files | sort %}
${PROJECT_SOURCE_DIR}/src/language/{{ file }}
${PROJECT_SOURCE_DIR}/src/language/{{ file.as_posix() }}
{% endfor %}
)

set(CODE_GENERATOR_YAML_FILES
{% for file in yaml_files | sort %}
${PROJECT_SOURCE_DIR}/src/language/{{ file }}
${PROJECT_SOURCE_DIR}/src/language/{{ file.as_posix() }}
{% endfor %}
)

Expand Down
2 changes: 1 addition & 1 deletion src/parser/diffeq_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ std::string DiffEqContext::get_non_cnexp_solution() const {
std::string result;
if (!deriv_invalid) {
result = get_cvode_linear_diffeq();
} else if (deriv_invalid and eqn_invalid) {
} else if (deriv_invalid && eqn_invalid) {
result = get_cvode_nonlinear_diffeq();
} else {
throw std::runtime_error("Error in differential equation solver with non-cnexp");
Expand Down
1 change: 1 addition & 0 deletions src/visitors/inline_visitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include <map>
#include <stack>
#include <string>

#include "symtab/decl.hpp"
#include "visitors/ast_visitor.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/visitors/local_var_rename_visitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include <map>
#include <stack>
#include <string>

#include "symtab/decl.hpp"
#include "visitors/ast_visitor.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/visitors/localize_visitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/

#include <map>
#include <string>

#include "symtab/decl.hpp"
#include "visitors/ast_visitor.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/visitors/sympy_conductance_visitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include <map>
#include <set>
#include <string>
#include <vector>

#include "visitors/ast_visitor.hpp"
Expand Down

0 comments on commit 4f47074

Please sign in to comment.