Skip to content

[Build] Support OpenAssetIO CI job#4

Merged
feltech merged 2 commits into
OpenAssetIO:mainfrom
feltech:work/714-ciJobForOpenAssetIO
Nov 8, 2022
Merged

[Build] Support OpenAssetIO CI job#4
feltech merged 2 commits into
OpenAssetIO:mainfrom
feltech:work/714-ciJobForOpenAssetIO

Conversation

@feltech

@feltech feltech commented Nov 7, 2022

Copy link
Copy Markdown
Member

Default to Release build and export symbols for embedded interpreter.

See OpenAssetIO/OpenAssetIO#723

If `libpython` is linked in to the `test.python.bridge` executable as a
static library, then by default none of `libpython`'s symbols will be
visible to Python extension modules, causing "undefined reference"
errors when importing. This is simply the default behaviour for
executable targets.

So instruct CMake to make the executable's symbols visible.

Signed-off-by: David Feltell <david.feltell@foundry.com>
The default is toolchain-specific (i.e. CMake generator-specific) and
this can cause unexpected errors.

E.g. if we've installed Python as a Release library, but this project is
built as a Debug library, then on Windows we'll try to link to
`python39_d`, i.e. the debug lib, which may not exist.

We could enforce that `CMAKE_BUILD_TYPE` is always set externally,
however if we forget then builds might just work, but then fail
unexpectedly if we swap the toolchain.

So better to just be consistent and default to Release in all cases,
unless explicitly overridden.

Signed-off-by: David Feltell <david.feltell@foundry.com>
Comment thread CMakeLists.txt
@feltech feltech merged commit ff1252f into OpenAssetIO:main Nov 8, 2022
@feltech feltech deleted the work/714-ciJobForOpenAssetIO branch November 8, 2022 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants