Skip to content

Commit 8f101e7

Browse files
committed
Limit the number of define exported from GNUstep
Some of the defines, such as `NDEBUG`, are C-level defines which influence the system behavior (e.g. enable/disabling `assert()` calls); this should be controlled by the user.
1 parent 9ac8c72 commit 8f101e7

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

gnustep-base/conanfile.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,13 @@ def package(self):
169169
if value:
170170
pc_data["cflags"].append(value)
171171

172-
pc_data["defines"] = pkg_config.defines
172+
# Export the defines which influence the behavior of GNUstep, but prevent generic defines,
173+
# such as NDEBUG or GSWARN and GSDIAGNOSE from being exported here; the user should be in control of those.
174+
defines = ["GNUSTEP_RUNTIME", "_NONFRAGILE_ABI", "GNUSTEP_BASE_LIBRARY", "GNUSTEP_WITH_DLL", "_NATIVE_OBJC_EXCEPTIONS"]
175+
for define in defines:
176+
value = next((x for x in pkg_config.defines if x.startswith(define)),None)
177+
if value:
178+
pc_data["defines"].append(value)
173179

174180
mkdir(self, os.path.dirname(self._pc_data_path))
175181
save(self, self._pc_data_path, yaml.dump(pc_data))

0 commit comments

Comments
 (0)