Skip to content

Commit

Permalink
Merge pull request #270 from perseoGI/fix-readme
Browse files Browse the repository at this point in the history
Fixed highlight numbers on py codeblock
  • Loading branch information
memsharded authored Jul 9, 2024
2 parents eb97607 + 0d33a2f commit 7b099ca
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions _posts/2024-07-09-Introducing-vendoring-packages.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ $ conan graph info . --format=html > graph.html
- Actually repackage the lib_a library inside the SDK. As we are generating a static library, we can achieve this by copying the ``liblib_a.a`` static library inside the SDK library
- Finally, update the ``cpp_info.libs`` adding the ``lib_a`` dependency for consumers

```py{8 9 14 15 43 48}
```py
from conan import ConanFile
from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps
from conan.tools.files import copy
Expand All @@ -125,13 +125,13 @@ import os
class sdkRecipe(ConanFile):
name = "sdk"
version = "1.0"
package_type = "static-library"
vendor = True
package_type = "static-library" # LINE CHANGE
vendor = True # LINE CHANGE

# Binary configuration
settings = "os", "compiler", "build_type", "arch"
options = {"fPIC": [True, False]}
default_options = {"fPIC": True}
options = {"fPIC": [True, False]} # LINE CHANGE
default_options = {"fPIC": True} # LINE CHANGE

# Sources are located in the same place as this recipe, copy them to the recipe
exports_sources = "CMakeLists.txt", "src/*", "include/*"
Expand Down Expand Up @@ -159,13 +159,14 @@ class sdkRecipe(ConanFile):

def package(self):
# Repackage static dependencies inside the package supporting different OS
# LINES CHANGE
copy(self, "*.a", src=self.dependencies["lib_a"].cpp_info.libdir, dst=os.path.join(self.package_folder, self.cpp_info.libdir))
copy(self, "*.lib", src=self.dependencies["lib_a"].cpp_info.libdir, dst=os.path.join(self.package_folder, self.cpp_info.libdir))
cmake = CMake(self)
cmake.install()

def package_info(self):
self.cpp_info.libs = ["sdk", "lib_a"]
self.cpp_info.libs = ["sdk", "lib_a"] # LINES CHANGE
```

 7. Apply the changes and create the SDK package:
Expand Down

0 comments on commit 7b099ca

Please sign in to comment.