Skip to content

Commit 7f52d88

Browse files
committed
Committing accumulated changes.
1 parent 282112f commit 7f52d88

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

SConscript

+9-2
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ elif build_config_compiler == "linux_gcc":
3434
std_opt = ["-std=%s" % pybind11_build_config["cxx_std"]]
3535
vis_opt = ["-fvisibility=hidden"]
3636
opt_opt = ["-O0", "-g"]
37-
wrn_opt = ["-Wall", "-Wextra", "-Wconversion", "-Wcast-qual", "-Wdeprecated", "-Wnon-virtual-dtor", "-Wunused-result"]
37+
wrn_opt = ["-Wall", "-Wextra", "-Wconversion", "-Wcast-qual", "-Wdeprecated", "-Wnon-virtual-dtor", "-Wunused-result", "-Werror"]
3838

3939
extra_defines = arguments_get_split("extra_defines")
4040
extra_defines.append("PYBIND11_STRICT_ASSERTS_CLASS_HOLDER_VS_TYPE_CASTER_MIX")
41+
extra_defines.append("PYBIND11_ENABLE_TYPE_CASTER_ODR_GUARD_IF_AVAILABLE")
4142

4243
def process_meta_opts():
4344
meta_opts = arguments_get_split("meta_opts")
@@ -122,12 +123,18 @@ for main_module in [
122123
"class_sh_module_local_0",
123124
"class_sh_module_local_1",
124125
"class_sh_module_local_2",
126+
"namespace_visibility_2",
125127
]:
126128
if Glob("#pybind11/tests/%s.cpp" % main_module):
127129
pybind11_tests_shared_library(
128130
target="#lib/%s" % main_module,
129131
sources=["%s.cpp" % main_module])
130132

133+
if Glob("#pybind11/tests/namespace_visibility_1.cpp"):
134+
pybind11_tests_shared_library(
135+
target="#lib/namespace_visibility_1",
136+
sources=["namespace_visibility_1.cpp", "namespace_visibility_1s.cpp"])
137+
131138
env_base.Clone(
132139
CPPDEFINES = extra_defines,
133140
CPPPATH=["#pybind11/include",
@@ -144,7 +151,7 @@ env_base.Clone(
144151
python_include,
145152
"#Catch2/single_include/catch2"],
146153
CXXFLAGS=std_opt + opt_opt + wrn_opt,
147-
LINKFLAGS=["-rdynamic"] + opt_opt,
154+
LINKFLAGS=["-Llib", "-rdynamic"] + opt_opt,
148155
LIBS=[python_lib, "pthread", "dl", "util"]).Program(
149156
target="#bin/test_embed",
150157
source=build_paths_in_subdir(

run_tests.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ def build_list_of_tests(tests_dirpath, substrings):
1414
"""."""
1515
all_test_py = []
1616
for node in os.listdir(tests_dirpath):
17-
if node.startswith("test_class_sh_") and node.endswith(".py"):
17+
if ((node.startswith("test_class_sh_") and node.endswith(".py")) or
18+
node == "test_exc_namespace_visibility.py"):
1819
all_test_py.append(node)
1920
continue
2021
if not node.startswith("test_") or not node.endswith(".cpp"):
@@ -134,7 +135,7 @@ def run(args):
134135
tests_dirpath = os.path.join(pybind11_dirpath, "tests")
135136
test_embed_dirpath = os.path.join(tests_dirpath, "test_embed")
136137
test_embed, list_of_test_py = build_list_of_tests(tests_dirpath, substrings)
137-
env = {"PYTHONPATH": normabspath("lib")}
138+
env = {"PYTHONPATH": normabspath("lib") + ":/foo/bar"}
138139
if test_embed:
139140
print('Running tests in directory "%s":' % test_embed_dirpath)
140141
sys.stdout.flush()

0 commit comments

Comments
 (0)