Skip to content

Commit ff1252f

Browse files
authored
Merge pull request #4 from feltech/work/714-ciJobForOpenAssetIO
[Build] Support OpenAssetIO CI job
2 parents 534c246 + 5723b02 commit ff1252f

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,23 @@
33

44
cmake_minimum_required(VERSION 3.21)
55

6-
project(OpenAssetIO-Test-CMake)
6+
# Set a default build type if none was specified.
7+
# The CMake default is toolchain-specific so ensure consistency by
8+
# having an explicit default.
9+
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
10+
message(STATUS "Setting build type to 'Release' as none was specified.")
11+
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
12+
# Set the possible values of build type for cmake-gui, ccmake
13+
set_property(
14+
CACHE CMAKE_BUILD_TYPE
15+
PROPERTY STRINGS
16+
"Debug"
17+
"Release"
18+
"MinSizeRel"
19+
"RelWithDebInfo")
20+
endif ()
721

22+
project(OpenAssetIO-Test-CMake)
823
enable_testing()
924

1025
#-----------------------------------------------------------------------
@@ -139,6 +154,9 @@ if (OPENASSETIOTEST_ENABLE_PYTHON)
139154
Python::Python
140155
)
141156
target_compile_features(test.python.bridge PRIVATE cxx_std_17)
157+
# If libpython is linked in as a static library, then we must export
158+
# symbols for dynamically loaded Python extension modules to use.
159+
set_target_properties(test.python.bridge PROPERTIES ENABLE_EXPORTS ON)
142160

143161
# Storage for list of environment variables to set before running
144162
# the test.

0 commit comments

Comments
 (0)