Comments (7)
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.
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.
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.
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.
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.
Can I close this ticket?
from fips.
Sure. :)
from fips.
Related Issues (20)
- c99
- Missing standard math library when build in Ubuntu. HOT 2
- fips diag tools for checking http-server??? HOT 2
- cmake.py/run_build() adds Visual Studio args for Android builds
- Install and CPack ? HOT 2
- MSVC treat warnings as errors HOT 4
- Is this FIPS possible to support VS2010 project? HOT 2
- How to use 'exec_program' in FIPS??? HOT 1
- LNK203 _MSC_VER HOT 2
- I find fips very interesting but ... HOT 1
- Ios Bundle assets and other Xcode settings HOT 3
- "fips run xxxxx" fails on github actions windows vm with "The system cannot find the path specified." HOT 4
- Moving Directories HOT 2
- android SDK changed the folder tree HOT 4
- Slow builds via cmd line HOT 3
- great build system, awesome! HOT 1
- Using --parallel in cmake does not build in parallel within projects HOT 4
- Included PyYaml (yaml3) breaks with python 3.10 HOT 2
- VSCode launch/build target fails HOT 3
- Working with projects outside the fips folder hierarchy is broken HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fips.