File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44cmake_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)
823enable_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.
You can’t perform that action at this time.
0 commit comments