Skip to content

Commit 6477723

Browse files
aaronj0guitargeek
authored andcommitted
fix dict names and symbol resolution issues on win
Thanks to Bertrand
1 parent 59bc6b9 commit 6477723

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

bindings/pyroot/cppyy/cppyy/test/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ foreach(DICT ${CPPYY_TEST_DICTS})
3737
target_compile_options(${DICT}Dict PRIVATE "-w")
3838
if(MSVC)
3939
target_link_libraries(${DICT}Dict PUBLIC Python3::Python)
40+
set_target_properties(${DICT}Dict PROPERTIES PREFIX "lib")
41+
set_target_properties(${DICT}Dict PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
4042
elseif(APPLE)
4143
target_link_libraries(${DICT}Dict PUBLIC -Wl,-bind_at_load -Wl,-w -Wl,-undefined -Wl,dynamic_lookup)
4244
else()
@@ -95,5 +97,9 @@ endif()
9597

9698
# Configure the tests
9799
foreach(TEST ${CPPYY_TESTS})
98-
ROOT_ADD_PYUNITTEST(${TEST} ${TEST}.py GENERIC ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_CURRENT_BINARY_DIR} PYTHON_DEPS pytest)
100+
if(MSVC)
101+
ROOT_ADD_PYUNITTEST(${TEST} ${TEST}.py GENERIC ENVIRONMENT PATH=${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG> PYTHON_DEPS pytest)
102+
else()
103+
ROOT_ADD_PYUNITTEST(${TEST} ${TEST}.py GENERIC ENVIRONMENT LD_LIBRARY_PATH=${CMAKE_CURRENT_BINARY_DIR} PYTHON_DEPS pytest)
104+
endif()
99105
endforeach()

0 commit comments

Comments
 (0)