Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating per-library EXPORT symbols #44

Merged
merged 2 commits into from
Sep 24, 2021

Conversation

aytey
Copy link
Contributor

@aytey aytey commented Sep 24, 2021

Makes the changes as discussed here:

I should note that this still doesn't work though (it does create cnip.exe though!) due to link failures in test-suite.exe:

<lots>
D:/DEV/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/test-suite.dir/tests/TestRunner.cpp.o:TestRunner.cpp:(.rdata$.refptr._ZN3psy1C10TestParser8case0002Ev[.refptr._ZN3psy1C10TestParser8case0002Ev]+0x0): undefined reference to `psy::C::TestParser::case0002()'
D:/DEV/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/test-suite.dir/tests/TestRunner.cpp.o:TestRunner.cpp:(.rdata$.refptr._ZN3psy1C10TestParser8case0001Ev[.refptr._ZN3psy1C10TestParser8case0001Ev]+0x0): undefined reference to `psy::C::TestParser::case0001()'
D:/DEV/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/test-suite.dir/tests/TestRunner.cpp.o:TestRunner.cpp:(.rdata$.refptr._ZTVN3psy1C10TestParserE[.refptr._ZTVN3psy1C10TestParserE]+0x0): undefined reference to `vtable for psy::C::TestParser'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

Signed-off-by: Andrew V. Jones [email protected]

@aytey
Copy link
Contributor Author

aytey commented Sep 24, 2021

Yeah, I have no idea why the test implementations go into psychecfe.{so,dll} -- it probably makes sense this "doesn't work", because things like TestBinder aren't dllexport'd.

@aytey
Copy link
Contributor Author

aytey commented Sep 24, 2021

If you're happy, I can just if out (in the top-level CMakeLists.txt) building the tests on Windows:

-set(PSYCHE_TESTS test-suite)
-add_executable(${PSYCHE_TESTS} ${PSYCHE_TESTS_SOURCES})
-target_link_libraries(${PSYCHE_TESTS} psychecfe psychecommon dl)
+IF (NOT WIN32 AND NOT MINGW)
+    set(PSYCHE_TESTS test-suite)
+    add_executable(${PSYCHE_TESTS} ${PSYCHE_TESTS_SOURCES})
+    target_link_libraries(${PSYCHE_TESTS} psychecfe psychecommon dl)
+endif()

This then successfully builds for me.

Signed-off-by: Andrew V. Jones <[email protected]>
@ltcmelo
Copy link
Owner

ltcmelo commented Sep 24, 2021

Thank you @andrewvaughanj !

@ltcmelo
Copy link
Owner

ltcmelo commented Sep 24, 2021

Feel free to add this.

@ltcmelo ltcmelo merged commit 85f39b1 into ltcmelo:master Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants