Skip to content

Commit

Permalink
Reenable mac tests, attempt to auto-use ld_classic outside broken cma…
Browse files Browse the repository at this point in the history
…ke detection

Signed-off-by: Tim Paine <[email protected]>
  • Loading branch information
timkpaine committed Feb 10, 2024
1 parent 8ce2eae commit 1637508
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,10 @@ jobs:

# Exclude macOS builds for now
- os: macos-12
# is-full-run: false # FIXME https://github.com/Point72/csp/issues/33
is-full-run: false # FIXME https://github.com/Point72/csp/issues/33

- os: macos-14
# is-full-run: false # FIXME https://github.com/Point72/csp/issues/33
is-full-run: false # FIXME https://github.com/Point72/csp/issues/33

# Exclude Python 3.8, 3.10, 3.11 builds
- is-full-run: false
Expand Down
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ option(CSP_BUILD_GPROF "Hook into gprof for profiling" OFF)
option(CSP_MANYLINUX "Build for python's manylinux setup" OFF)
option(CSP_USE_VCPKG "Build with vcpkg dependencies" ON)
option(CSP_USE_CCACHE "Build with ccache caching" OFF)
option(CSP_USE_LD_CLASSIC_MAC "On macOS, link with ld_classic" OFF)

# Extension options
option(CSP_BUILD_KAFKA_ADAPTER "Build kafka adapter" ON)
Expand Down Expand Up @@ -115,8 +116,11 @@ if(MACOS)
set(THREADS_PREFER_PTHREAD_FLAG ON)

# for exception unwinding on macOS
check_linker_flag(CXX "-Wl,-ld_classic" HAS_LD_CLASSIC_MAC)
if(HAS_LD_CLASSIC_MAC)
# TODO this does not work, which would be the
# proper cmake way of doing it, so instead we
# use a vanilla option
# check_linker_flag(CXX "-Wl,-ld_classic" CSP_USE_LD_CLASSIC_MAC)
if(CSP_USE_LD_CLASSIC_MAC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-ld_classic")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-ld_classic")
endif()
Expand Down
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
os.environ["OSX_DEPLOYMENT_TARGET"] = os.environ.get("OSX_DEPLOYMENT_TARGET", "10.13")
os.environ["MACOSX_DEPLOYMENT_TARGET"] = os.environ.get("OSX_DEPLOYMENT_TARGET", "10.13")

if hasattr(platform, "mac_ver") and platform.mac_ver()[0].startswith("14"):
cmake_args.append("-DCSP_USE_LD_CLASSIC_MAC=ON")

if which("ccache"):
cmake_args.append("-DCSP_USE_CCACHE=On")

Expand Down

0 comments on commit 1637508

Please sign in to comment.