Skip to content

Commit

Permalink
remove option.fPIC for shared in conan new templates (#13066)
Browse files Browse the repository at this point in the history
* remove option.fPIC for shared

* fix test
  • Loading branch information
memsharded authored Feb 10, 2023
1 parent df521af commit d9dc619
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 12 deletions.
6 changes: 5 additions & 1 deletion conan/internal/api/new/autotools_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ class {{package_name}}Conan(ConanFile):
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
self.options.rm_safe("fPIC")
def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")
def layout(self):
basic_layout(self)
Expand Down
6 changes: 5 additions & 1 deletion conan/internal/api/new/bazel_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ class {{package_name}}Recipe(ConanFile):
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
self.options.rm_safe("fPIC")
def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")
def layout(self):
bazel_layout(self)
Expand Down
6 changes: 5 additions & 1 deletion conan/internal/api/new/cmake_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ class {{package_name}}Recipe(ConanFile):
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
self.options.rm_safe("fPIC")
def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")
def layout(self):
cmake_layout(self)
Expand Down
6 changes: 5 additions & 1 deletion conan/internal/api/new/meson_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ class {{package_name}}Conan(ConanFile):
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
self.options.rm_safe("fPIC")
def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")
def layout(self):
basic_layout(self)
Expand Down
6 changes: 5 additions & 1 deletion conans/test/assets/pkg_cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ class Pkg(ConanFile):
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
self.options.rm_safe("fPIC")
def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")
def layout(self):
cmake_layout(self)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ class App(ConanFile):
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
self.options.rm_safe("fPIC")
def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")
def build(self):
env_build = Autotools(self)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ class MyLibConan(ConanFile):
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
self.options.rm_safe("fPIC")
def layout(self):
basic_layout(self)
Expand Down
6 changes: 5 additions & 1 deletion conans/test/functional/toolchains/meson/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ class App(ConanFile):
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
self.options.rm_safe("fPIC")
def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")
def layout(self):
self.folders.build = "build"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ def layout(self):
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
self.options.rm_safe("fPIC")
def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")
def generate(self):
tc = MesonToolchain(self)
Expand Down
6 changes: 5 additions & 1 deletion conans/test/functional/toolchains/meson/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ class App(ConanFile):
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
self.options.rm_safe("fPIC")
def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")
def layout(self):
self.folders.build = "build"
Expand Down
6 changes: 5 additions & 1 deletion conans/test/functional/toolchains/meson/test_meson.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ class App(ConanFile):
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
self.options.rm_safe("fPIC")
def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")
def layout(self):
self.folders.generators = 'build/gen_folder'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ def layout(self):
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
self.options.rm_safe("fPIC")
def configure(self):
if self.options.shared:
self.options.rm_safe("fPIC")
def generate(self):
tc = MesonToolchain(self)
Expand Down

0 comments on commit d9dc619

Please sign in to comment.