Skip to content

Commit

Permalink
mingw fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiud committed Oct 8, 2023
1 parent 0887824 commit ea3f38d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ add_library (glog_internal OBJECT
${GLOG_SRCS}
)
target_compile_features (glog_internal PUBLIC $<TARGET_PROPERTY:glog,COMPILE_FEATURES>)
set_target_properties (glog_internal PROPERTIES DEFINE_SYMBOL GOOGLE_GLOG_IS_A_DLL)

add_library (glog
$<TARGET_OBJECTS:glog_internal>
Expand Down Expand Up @@ -626,12 +627,14 @@ if (BUILD_TESTING)
src/logging_unittest.cc
)

target_compile_definitions (logging_unittest PRIVATE GLOG_STATIC_DEFINE)
target_link_libraries (logging_unittest PRIVATE ${_GLOG_TEST_LIBS})

add_executable (stl_logging_unittest
src/stl_logging_unittest.cc
)

target_compile_definitions (stl_logging_unittest PRIVATE GLOG_STATIC_DEFINE)
target_link_libraries (stl_logging_unittest PRIVATE ${_GLOG_TEST_LIBS})

if (HAVE_NO_DEPRECATED)
Expand All @@ -649,34 +652,39 @@ if (BUILD_TESTING)
src/symbolize_unittest.cc
)

target_compile_definitions (symbolize_unittest PRIVATE GLOG_STATIC_DEFINE)
target_link_libraries (symbolize_unittest PRIVATE ${_GLOG_TEST_LIBS})
endif (HAVE_SYMBOLIZE)

add_executable (demangle_unittest
src/demangle_unittest.cc
)

target_compile_definitions (demangle_unittest PRIVATE GLOG_STATIC_DEFINE)
target_link_libraries (demangle_unittest PRIVATE ${_GLOG_TEST_LIBS})

if (HAVE_STACKTRACE)
add_executable (stacktrace_unittest
src/stacktrace_unittest.cc
)

target_compile_definitions (stacktrace_unittest PRIVATE GLOG_STATIC_DEFINE)
target_link_libraries (stacktrace_unittest PRIVATE ${_GLOG_TEST_LIBS})
endif (HAVE_STACKTRACE)

add_executable (utilities_unittest
src/utilities_unittest.cc
)

target_compile_definitions (utilities_unittest PRIVATE GLOG_STATIC_DEFINE)
target_link_libraries (utilities_unittest PRIVATE ${_GLOG_TEST_LIBS})

if (HAVE_STACKTRACE AND HAVE_SYMBOLIZE)
add_executable (signalhandler_unittest
src/signalhandler_unittest.cc
)

target_compile_definitions (signalhandler_unittest PRIVATE GLOG_STATIC_DEFINE)
target_link_libraries (signalhandler_unittest PRIVATE ${_GLOG_TEST_LIBS})
endif (HAVE_STACKTRACE AND HAVE_SYMBOLIZE)

Expand Down Expand Up @@ -723,6 +731,7 @@ if (BUILD_TESTING)
src/mock-log.h
)

target_compile_definitions (mock-log_unittest PRIVATE GLOG_STATIC_DEFINE)
target_link_libraries (mock-log_unittest PRIVATE ${_GLOG_TEST_LIBS})

add_test (NAME mock-log COMMAND mock-log_unittest)
Expand Down Expand Up @@ -785,16 +794,19 @@ if (BUILD_TESTING)
add_executable (cleanup_immediately_unittest
src/cleanup_immediately_unittest.cc)

target_compile_definitions (cleanup_immediately_unittest PRIVATE GLOG_STATIC_DEFINE)
target_link_libraries (cleanup_immediately_unittest PRIVATE ${_GLOG_TEST_LIBS})

add_executable (cleanup_with_absolute_prefix_unittest
src/cleanup_with_absolute_prefix_unittest.cc)

target_compile_definitions (cleanup_with_absolute_prefix_unittest PRIVATE GLOG_STATIC_DEFINE)
target_link_libraries (cleanup_with_absolute_prefix_unittest PRIVATE ${_GLOG_TEST_LIBS})

add_executable (cleanup_with_relative_prefix_unittest
src/cleanup_with_relative_prefix_unittest.cc)

target_compile_definitions (cleanup_with_relative_prefix_unittest PRIVATE GLOG_STATIC_DEFINE)
target_link_libraries (cleanup_with_relative_prefix_unittest PRIVATE ${_GLOG_TEST_LIBS})

set (CLEANUP_LOG_DIR ${CMAKE_CURRENT_BINARY_DIR}/cleanup_tests)
Expand Down

0 comments on commit ea3f38d

Please sign in to comment.