Skip to content

Commit

Permalink
Fixes from uilianries review
Browse files Browse the repository at this point in the history
  • Loading branch information
paulharris committed Oct 19, 2022
1 parent f07530b commit c19f33a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 28 deletions.
10 changes: 2 additions & 8 deletions recipes/nasm/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def config_options(self):
del self.options.fPIC

def configure(self):
# for plain C projects only
try:
del self.settings.compiler.libcxx
except Exception:
Expand All @@ -42,12 +41,8 @@ def configure(self):
pass

def layout(self):
# src_folder must use the same source folder name the project
basic_layout(self, src_folder="src")

# no requirements(self)
# no validate(self)

def build_requirements(self):
if self.info.settings.os == "Windows":
self.tool_requires("strawberryperl/5.30.0.1")
Expand All @@ -59,8 +54,6 @@ def package_id(self):
del self.info.settings.compiler

def generate(self):
# --fpic is automatically managed when 'fPIC'option is declared
# --enable/disable-shared is automatically managed when 'shared' option is declared
tc = AutotoolsToolchain(self)
if is_msvc(self):
VCVars(self).generate()
Expand All @@ -71,7 +64,6 @@ def generate(self):
tc.extra_cflags.append("-m64")
tc.generate()

# required as we have some tool_requires
env = VirtualBuildEnv(self)
env.generate()

Expand Down Expand Up @@ -119,5 +111,7 @@ def package(self):
def package_info(self):
bin_path = os.path.join(self.package_folder, "bin")
self.output.info("Appending PATH environment variable: {}".format(bin_path))
self.env_info.PATH.append(bin_path)
self.env_info.libdirs = []
self.buildenv_info.append_path("PATH", bin_path)
self.cpp_info.includedirs = []
12 changes: 0 additions & 12 deletions recipes/nasm/all/test_package/CMakeLists.txt

This file was deleted.

13 changes: 6 additions & 7 deletions recipes/nasm/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,22 @@


class TestPackageConan(ConanFile):
# settings = "os", "arch",
settings = "os", "arch", "compiler", "build_type"
generators = "VirtualRunEnv"
generators = "VirtualBuildEnv"
test_type = "explicit"

def requirements(self):
self.requires(self.tested_reference_str)
def build_requirements(self):
self.tool_requires(self.tested_reference_str)

def test(self):
if can_run(self):
self.run("nasm --version", env="conanrun")
self.run("nasm --version", env="conanbuild")
asm_file = os.path.join(self.source_folder, "hello_linux.asm")
out_file = os.path.join(self.build_folder, "hello_linux.o")
bin_file = os.path.join(self.build_folder, "hello_linux")
self.run(f"nasm -felf64 {asm_file} -o {out_file}", env="conanrun")
self.run(f"nasm -felf64 {asm_file} -o {out_file}", env="conanbuild")
if self.settings.os == "Linux" and self.settings.arch == "x86_64":
# TODO was tools.get_env, what should it be?
ld = os.getenv("LD", "ld")
self.run(f"{ld} hello_linux.o -o {bin_file}", env="conanrun")
self.run(f"{ld} hello_linux.o -o {bin_file}", env="conanbuild")
self.run(bin_file)
2 changes: 1 addition & 1 deletion recipes/nasm/all/test_v1_package/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


class TestPackageConan(ConanFile):
settings = "os", "arch",
settings = "os", "arch", "compiler", "build_type"

def test(self):
if not tools.cross_building(self, skip_x64_x86=True):
Expand Down

0 comments on commit c19f33a

Please sign in to comment.