mirror of
https://github.com/KjellKod/g3log.git
synced 2024-12-13 10:42:56 +01:00
Cross-compiling: Version readout fixed (#189)
* Cross-comoiling: Version readout fixed Test.cmake: Path handling consistent * ".x" syntax in variable checking removed * Use G3LOG_DEBUG also in linux-specific code * Fixed error when linux and shared library is on * Fixed linux/windows shared lib handling: FATAL_ERROR for wrong cmake version and no message in linux
This commit is contained in:
parent
769feca4d0
commit
ac37076327
10
Build.cmake
10
Build.cmake
@ -107,10 +107,12 @@ ENDIF()
|
|||||||
SET(G3LOG_LIBRARY g3logger)
|
SET(G3LOG_LIBRARY g3logger)
|
||||||
|
|
||||||
IF( G3_SHARED_LIB )
|
IF( G3_SHARED_LIB )
|
||||||
IF(NOT(CMAKE_VERSION LESS 3.4))
|
IF( WIN32 )
|
||||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
IF(NOT(CMAKE_VERSION LESS 3.4))
|
||||||
ELSE()
|
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||||
message( FATAL "Need CMake version >=3.4 to build shared windows library!" )
|
ELSE()
|
||||||
|
message( FATAL_ERROR "Need CMake version >=3.4 to build shared windows library!" )
|
||||||
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ADD_LIBRARY(${G3LOG_LIBRARY} SHARED ${SRC_FILES})
|
ADD_LIBRARY(${G3LOG_LIBRARY} SHARED ${SRC_FILES})
|
||||||
ELSE()
|
ELSE()
|
||||||
|
@ -71,8 +71,8 @@ endif()
|
|||||||
|
|
||||||
|
|
||||||
SET(MAJOR_VERSION 1)
|
SET(MAJOR_VERSION 1)
|
||||||
IF (${VERSION}.x STREQUAL ".x")
|
IF ( NOT VERSION )
|
||||||
IF (MSVC)
|
IF ( "${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows" )
|
||||||
message("windows: Extracting git software version")
|
message("windows: Extracting git software version")
|
||||||
execute_process(COMMAND powershell "(git rev-list --branches HEAD | Measure-Object -line).Lines" OUTPUT_VARIABLE GIT_VERSION WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
|
execute_process(COMMAND powershell "(git rev-list --branches HEAD | Measure-Object -line).Lines" OUTPUT_VARIABLE GIT_VERSION WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
|
||||||
ELSE()
|
ELSE()
|
||||||
|
@ -74,7 +74,7 @@
|
|||||||
add_library(tester_sharedlib SHARED ${DIR_UNIT_TEST}/tester_sharedlib.h ${DIR_UNIT_TEST}/tester_sharedlib.cpp)
|
add_library(tester_sharedlib SHARED ${DIR_UNIT_TEST}/tester_sharedlib.h ${DIR_UNIT_TEST}/tester_sharedlib.cpp)
|
||||||
target_link_libraries(tester_sharedlib ${G3LOG_LIBRARY})
|
target_link_libraries(tester_sharedlib ${G3LOG_LIBRARY})
|
||||||
|
|
||||||
add_executable(test_dynamic_loaded_shared_lib ../test_main/test_main.cpp ${DIR_UNIT_TEST}/test_linux_dynamic_loaded_sharedlib.cpp)
|
add_executable(test_dynamic_loaded_shared_lib ${g3log_SOURCE_DIR}/test_main/test_main.cpp ${DIR_UNIT_TEST}/test_linux_dynamic_loaded_sharedlib.cpp)
|
||||||
set_target_properties(test_dynamic_loaded_shared_lib PROPERTIES COMPILE_DEFINITIONS "GTEST_HAS_TR1_TUPLE=0")
|
set_target_properties(test_dynamic_loaded_shared_lib PROPERTIES COMPILE_DEFINITIONS "GTEST_HAS_TR1_TUPLE=0")
|
||||||
set_target_properties(test_dynamic_loaded_shared_lib PROPERTIES COMPILE_DEFINITIONS "GTEST_HAS_RTTI=0")
|
set_target_properties(test_dynamic_loaded_shared_lib PROPERTIES COMPILE_DEFINITIONS "GTEST_HAS_RTTI=0")
|
||||||
target_link_libraries(test_dynamic_loaded_shared_lib ${G3LOG_LIBRARY} -ldl gtest_170_lib )
|
target_link_libraries(test_dynamic_loaded_shared_lib ${G3LOG_LIBRARY} -ldl gtest_170_lib )
|
||||||
|
@ -11,12 +11,6 @@
|
|||||||
#include <g3log/logworker.hpp>
|
#include <g3log/logworker.hpp>
|
||||||
#include "tester_sharedlib.h"
|
#include "tester_sharedlib.h"
|
||||||
|
|
||||||
#if (defined(CHANGE_G3LOG_DEBUG_TO_DBUG))
|
|
||||||
#define DEBUG_NAME DBUG
|
|
||||||
#else
|
|
||||||
#define DEBUG_NAME DEBUG
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct RuntimeLoadedLib : public SomeLibrary {
|
struct RuntimeLoadedLib : public SomeLibrary {
|
||||||
|
|
||||||
RuntimeLoadedLib() {
|
RuntimeLoadedLib() {
|
||||||
@ -25,7 +19,7 @@ struct RuntimeLoadedLib : public SomeLibrary {
|
|||||||
}
|
}
|
||||||
|
|
||||||
~RuntimeLoadedLib() {
|
~RuntimeLoadedLib() {
|
||||||
LOG(DEBUG_NAME) << "Library destroyed";
|
LOG(G3LOG_DEBUG) << "Library destroyed";
|
||||||
}
|
}
|
||||||
|
|
||||||
void action() {
|
void action() {
|
||||||
|
Loading…
Reference in New Issue
Block a user