Skip to content

Commit dc5a78d

Browse files
committed
Merge remote-tracking branch 'origin/master' into pybind11
2 parents bc4224d + 9dcffe8 commit dc5a78d

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

cmake/G3Test.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
#include <sstream>
1010
#include <string>
1111
#include <vector>
12+
#ifdef USE_PYTHON
13+
#include <pybindings.h>
14+
#endif
1215

1316
#define STRINGIZE(s) STRINGIZE_DIRECT(s)
1417
#define STRINGIZE_DIRECT(s) #s
@@ -142,7 +145,7 @@ G3Test::testEquivalence(__FILE__, __LINE__, left, right, STRINGIZE(left), STRING
142145
/// other catch block.
143146
#ifdef USE_PYTHON
144147
#define G3TEST_CATCH_PYTHON_ERROR \
145-
catch(const pybind11::error_already_set& ex){ \
148+
catch(const py::error_already_set& ex){ \
146149
PyErr_Print(); \
147150
}
148151
#else

cmake/Spt3gIncludes.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ endmacro(add_spt3g_program prog_name)
2828

2929
macro(add_spt3g_executable prog_name)
3030
add_executable(${prog_name} ${ARGN})
31+
if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
32+
# Assume Linux-style ld linker
33+
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.17)
34+
target_link_options(${prog_name} PUBLIC "LINKER:--no-as-needed")
35+
else()
36+
set_target_properties(${prog_name} PROPERTIES LINK_FLAGS "-Wl,--no-as-needed")
37+
endif()
38+
endif()
3139
target_link_libraries(${prog_name} pybind11::embed)
3240
endmacro(add_spt3g_executable prog_name)
3341

0 commit comments

Comments
 (0)