aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #99 from xantares/wineSilvio Traversaro2021-04-291-17/+4
|\ | | | | cmake: use CROSSCOMPILING_EMULATOR
| * cmake: use CROSSCOMPILING_EMULATORMichel Zou2021-04-271-17/+4
| |
* | CMake: Bumpr versionxantares2021-04-271-1/+1
|/ | | | Silents warnings, cmake 3.2 is available in distros since many years
* cmake: add support to build test-dladdr on unix like osRalf Habacker2021-01-171-1/+3
| | | | This is used to obtain test result references.
* cmake: Keep warning in sync with Makefile based build systemRalf Habacker2020-11-091-0/+6
|
* Add cmake building support to Travis CIRalf Habacker2020-11-091-1/+1
| | | | | | To make it easier to extend the CI support and to be able to execute the contained tests locally, a dedicated shell script tools/ci_build.sh was added to execute the tests.
* cmake: add option ENABLE_WINE to enable support for running cross compiled ↵Ralf Habacker2020-11-091-1/+20
| | | | | | | | | | | | | tests with wine For details about the ENABLE_WINE option, which support three modes AUTO|ON|OFF see the documentation of cmake macro check_auto_option(). A custom path for the wine executable can be specified by adding -DWINE_EXECUTABLE=<path> to the cmake command line. The cmake related macros were copied from https://gitlab.freedesktop.org/dbus/dbus/-/blob/master/cmake/modules/Macros.cmake
* cmake: Let make target 'test' be accessable from topmost build directoryRalf Habacker2020-11-091-1/+2
| | | | | | The cmake command enable_testing() must be placed in the topmost CMakeLists.txt so that the make target 'test' is available in the topmost build directory.
* cmake: place all generated binaries into one placeRalf Habacker2020-11-021-0/+4
| | | | | This is required for running test applications, because by default cmake places binaries into the associated subdir.
* Move cmake targets into sub directoriesRalf Habacker2020-09-141-55/+3
|
* Update minimum required cmake version to 2.8.11 to simplify codeRalf Habacker2020-09-141-30/+25
| | | | | | According to https://cmake.org/pipermail/cmake/2013-May/054792.html cmake 2.8.11 was released in 2013, so we can assume that no older version will be used anymore.
* Load Psapi.dll at runtime, this avoids linking caveatPali Rohár2019-05-061-1/+0
|
* Implement support for dlsym() with RTLD_DEFAULT and RTLD_NEXTPali Rohár2019-02-141-0/+3
| | | | | | | | | | | | | | | | | | | dlsym() with RTLD_DEFAULT handle behaves in same way like with global handle returned by dlopen() with NULL file name. dlsym() with RTLD_NEXT handle search for next loaded module which provides specified symbol. "Next" means module which in EnumProcessModules() result after the module which called dlsym(). To get caller function of dlsym() use _ReturnAddress() intrinsic. To get module where is caller function use the fact that HMODULE is the same value as the module's base address. When compiling under gcc, defines _ReturnAddress() macro via gcc's builtin as it does not provide MSC's specific _ReturnAddress() intrinsic. Added tests demonstrate that both RTLD_DEFAULT and RTLD_NEXT are working as expected.
* Fix resolving global symbols when LoadLibrary() is called after dlopen()Pali Rohár2019-02-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Usage of first_automatic_object cache is wrong. This cache is filled by all loaded DLL files (either implicitly or explicitly with LoadLibrary() call) by EnumProcessModules() call at first usage of dlopen(). So dlsym() can resolve global symbols only if they were loaded prior to dlopen() call. Any future usage of LoadLibrary() does not include newly loaded DLLs into first_automatic_object cache. To fix this problem, first_automatic_object cache is fully removed and EnumProcessModules() call is issued directly in dlsym() call. As EnumProcessModules() returns all DLLs, included those which were loaded by dlopen() with RTLD_LOCAL, it may break RTLD_LOCAL support. To address this problem switch linked-list of all loaded DLLs with RTLD_GLOBAL to linked-list of all loaded DLLs with RTLD_LOCAL flag. And then skip modules from EnumProcessModules() which are in linked-list. Also in WinAPI all DLLs loaded by LoadLibrary() behaves like RTLD_GLOBAL. So above change is compatible with this behavior. There may be another problem. Before retrieving HMODULE for DLL filename (which is done by LoadLibrary()), it is not possible to detect if DLL was already loaded by RTLD_LOCAL or not. And after calling LoadLibrary() it is not possible to know if DLL was loaded either by dlsym() with RTLD_LOCAL or by LoadLibrary() (which is equivalent to RTLD_GLOBAL). To address this problem, compare number of loaded modules (counted by EnumProcessModules()) before and after LoadLibrary() called from dlsym(). If number does not change it means that DLL was already loaded. So based on this result either add or remove HMODULE from linked-list of RTLD_LOCAL modules. Added test demonstrate usage of: global = dlopen(NULL, RTLD_GLOBAL); /* global handle */ LoadLibrary("library.dll"); /* this provides function */ function = dlsym(global, "function"); /* resolve function from library.dll */
* Add CMake code to export a CMake config fileSilvio2016-12-271-2/+36
|
* Removed wine detectionxantares2016-03-231-5/+1
| | | It can be set canonically by using CMAKE_CROSSCOMPILIING_EMULATOR variable
* Add linked modules to a separate global listTimothy Gu2015-03-151-0/+1
| | | | Fixes #2.
* Define SHARED when building shared libraryTimothy Gu2015-03-151-0/+4
|
* set CMAKE_BUILD_TYPE defaultxantares2015-03-121-2/+6
| | | it's used to set release flags
* Initial cmake portxantares2014-09-231-0/+30