Giter VIP home page Giter VIP logo

Comments (7)

floooh avatar floooh commented on June 14, 2024

I would rather add a new keyword 'fips_begin_sharedlib()'? I currently don't have a use case for shared libs, and might not be able to test this well on all platforms though.

from fips.

floooh avatar floooh commented on June 14, 2024

I have added a fips_begin_sharedlib()/fips_end_sharedlib() macro, and added a very simple example to fips-hello-dep1 (https://github.com/floooh/fips-hello-dep1/blob/master/src/sharedlib_test/CMakeLists.txt), I only quickly tested compilation on OSX (results in a .dylib file) and Windows, the DLL is built to fips-deploy/[project]/[config].

Let me know if I forgot something :)

from fips.

floooh avatar floooh commented on June 14, 2024

Reminder for Linux:

Linking CXX shared library /home/travis/build/floooh/fips-deploy/fips-hello-dep1/linux-make-debug/libdep1shared.so

/usr/bin/ld: ../dep1/libdep1.a(dep1.cc.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC

../dep1/libdep1.a: could not read symbols: Bad value

collect2: error: ld returned 1 exit status

make[2]: *** [/home/travis/build/floooh/fips-deploy/fips-hello-dep1/linux-make-debug/libdep1shared.so] Error 1

make[1]: *** [src/sharedlib_test/CMakeFiles/dep1shared.dir/all] Error 2

make[1]: *** Waiting for unfinished jobs....

[100%] Built target dep1test

from fips.

code-disaster avatar code-disaster commented on June 14, 2024

For some reason I don't understand, dependencies are not handled properly yet. I have a shared library with one module using "fips_libs(OpenGL32)" which fails to link because of missing GL symbols. Debug CMake output indicates that the module is processed after the shared lib.

OS X links fine. Linux gives a linker relocation error similar to yours above.

edit:

I "fixed" the dependency issue by changing the order in which fips_add_subdirectory() was called, moving the directory which contains the shared library after the module which depends on OpenGL32.lib.

It may be unreasonably complicated to change the system to be independent of declaration order of modules, which would probably mean to defer all the fips_end_*() logic until the fips_finish() call.

from fips.

floooh avatar floooh commented on June 14, 2024

Hmm, good catch, I can reproduce this by moving the Oryol samples includes above the modules in the root CMakeLists.txt. I'll open a separate ticket for this, but I agree that moving dependency resolution to the end might be too complex... I'll put at least a note into the docs for now.

from fips.

floooh avatar floooh commented on June 14, 2024

Can I close this ticket?

from fips.

code-disaster avatar code-disaster commented on June 14, 2024

Sure. :)

from fips.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.