Skip to content

Commit

Permalink
fix: Path separator depends on os
Browse files Browse the repository at this point in the history
  • Loading branch information
NelDav committed Nov 24, 2023
1 parent 3bbbbb3 commit 7656e91
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions recipes/cantera/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,31 +59,34 @@ def layout(self):

def build(self):

opt = "build -j4 " \
if self.settings.os == "Windows":
opt = "toolchain=msvc "
cd_modifier = "/d"
path_sep = ';'
else:
opt = ""
cd_modifier = ""
path_sep = ','

opt = opt +\
"prefix={} ".format(self.package_folder) +\
"libdirname=lib " \
"python_package=none " \
"f90_interface=n " \
"googletest=none " \
"versioned_shared_library=yes " \
"extra_inc_dirs={} ".format(';'.join(self.scons_extra_inc_dirs)) +\
"extra_lib_dirs={} ".format(';'.join(self.scons_extra_lib_dirs)) +\
"extra_inc_dirs={} ".format(path_sep.join(self.scons_extra_inc_dirs)) +\
"extra_lib_dirs={} ".format(path_sep.join(self.scons_extra_lib_dirs)) +\
"boost_inc_dir={} ".format(self.scons_boost_inc_dir) +\
"sundials_include={} ".format(self.scons_sundials_include) +\
"sundials_libdir={} ".format(self.scons_sundials_libdir)

if self.settings.os == "Windows":
opt = opt + "toolchain=msvc "
cd_modifier = "/d"
else:
cd_modifier = ""

if self.settings.build_type == "Debug":
opt = opt + "optimize=no "
else:
opt = opt + "debug=no "

self.run("cd {} {} && scons {}".format(cd_modifier, self.source_folder, opt))
self.run("cd {} {} && scons build -j4 {}".format(cd_modifier, self.source_folder, opt))

def package(self):
if self.settings.os == "Windows":
Expand Down

0 comments on commit 7656e91

Please sign in to comment.