Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
fmt
Commits
f286139d
Commit
f286139d
authored
Jun 01, 2021
by
Владислав Щапов
Committed by
Victor Zverovich
Jun 02, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix "undefined reference to `fmt::v7::detail::basic_data<void>::digits'"
Remove unused FMT_EXTERN_TEMPLATE_API
parent
7b9d69b8
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
61 additions
and
4 deletions
+61
-4
include/fmt/core.h
include/fmt/core.h
+4
-3
include/fmt/format.h
include/fmt/format.h
+1
-1
test/CMakeLists.txt
test/CMakeLists.txt
+15
-0
test/static-export-test/CMakeLists.txt
test/static-export-test/CMakeLists.txt
+30
-0
test/static-export-test/library.cc
test/static-export-test/library.cc
+5
-0
test/static-export-test/main.cc
test/static-export-test/main.cc
+6
-0
No files found.
include/fmt/core.h
View file @
f286139d
...
@@ -253,9 +253,10 @@
...
@@ -253,9 +253,10 @@
# endif
# endif
#else
#else
# define FMT_CLASS_API
# define FMT_CLASS_API
# if defined(__GNUC__) || defined(__clang__)
# if defined(FMT_EXPORT) || defined(FMT_SHARED)
# define FMT_API __attribute__((visibility("default")))
# if defined(__GNUC__) || defined(__clang__)
# define FMT_EXTERN_TEMPLATE_API FMT_API
# define FMT_API __attribute__((visibility("default")))
# endif
# endif
# endif
#endif
#endif
#ifndef FMT_API
#ifndef FMT_API
...
...
include/fmt/format.h
View file @
f286139d
...
@@ -902,7 +902,7 @@ template <typename T = void> struct basic_data {
...
@@ -902,7 +902,7 @@ template <typename T = void> struct basic_data {
FMT_API
static
constexpr
const
char
right_padding_shifts
[]
=
{
0
,
31
,
0
,
1
,
0
};
FMT_API
static
constexpr
const
char
right_padding_shifts
[]
=
{
0
,
31
,
0
,
1
,
0
};
};
};
#if
ndef FMT_HEADER_ONLY
#if
def FMT_SHARED
// Required for -flto, -fivisibility=hidden and -shared to work
// Required for -flto, -fivisibility=hidden and -shared to work
extern
template
struct
basic_data
<
void
>;
extern
template
struct
basic_data
<
void
>;
#endif
#endif
...
...
test/CMakeLists.txt
View file @
f286139d
...
@@ -213,6 +213,21 @@ if (FMT_PEDANTIC AND NOT WIN32)
...
@@ -213,6 +213,21 @@ if (FMT_PEDANTIC AND NOT WIN32)
"-DCMAKE_BUILD_TYPE=
${
CMAKE_BUILD_TYPE
}
"
)
"-DCMAKE_BUILD_TYPE=
${
CMAKE_BUILD_TYPE
}
"
)
endif
()
endif
()
# This test are disabled on Windows because it is only *NIX issue.
if
(
FMT_PEDANTIC AND NOT WIN32
)
add_test
(
static-export-test
${
CMAKE_CTEST_COMMAND
}
-C
${
CMAKE_BUILD_TYPE
}
--build-and-test
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/static-export-test"
"
${
CMAKE_CURRENT_BINARY_DIR
}
/static-export-test"
--build-generator
${
CMAKE_GENERATOR
}
--build-makeprogram
${
CMAKE_MAKE_PROGRAM
}
--build-options
"-DCMAKE_CXX_COMPILER=
${
CMAKE_CXX_COMPILER
}
"
"-DCMAKE_CXX_STANDARD=
${
CMAKE_CXX_STANDARD
}
"
"-DCMAKE_BUILD_TYPE=
${
CMAKE_BUILD_TYPE
}
"
)
endif
()
# Activate optional CUDA tests if CUDA is found. For version selection see
# Activate optional CUDA tests if CUDA is found. For version selection see
# https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#cpp14-language-features
# https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#cpp14-language-features
if
(
FMT_CUDA_TEST
)
if
(
FMT_CUDA_TEST
)
...
...
test/static-export-test/CMakeLists.txt
0 → 100644
View file @
f286139d
cmake_minimum_required
(
VERSION 3.1...3.18
)
project
(
fmt-link CXX
)
set
(
BUILD_SHARED_LIBS OFF
)
set
(
CMAKE_VISIBILITY_INLINES_HIDDEN TRUE
)
set
(
CMAKE_CXX_VISIBILITY_PRESET
"hidden"
)
# Broken LTO on GCC 4
if
(
CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5
)
set
(
BROKEN_LTO ON
)
endif
()
if
(
NOT BROKEN_LTO AND CMAKE_VERSION VERSION_GREATER
"3.8"
)
# CMake 3.9+
include
(
CheckIPOSupported
)
check_ipo_supported
(
RESULT HAVE_IPO
)
if
(
HAVE_IPO
)
set
(
CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE
)
endif
()
endif
()
add_subdirectory
(
../.. fmt
)
set_property
(
TARGET fmt PROPERTY POSITION_INDEPENDENT_CODE ON
)
add_library
(
library-test SHARED library.cc
)
target_link_libraries
(
library-test PRIVATE fmt::fmt
)
add_executable
(
exe-test main.cc
)
target_link_libraries
(
exe-test PRIVATE library-test
)
test/static-export-test/library.cc
0 → 100644
View file @
f286139d
#include <fmt/compile.h>
__attribute__
((
visibility
(
"default"
)))
std
::
string
foo
()
{
return
fmt
::
format
(
FMT_COMPILE
(
"foo bar {}"
),
4242
);
}
test/static-export-test/main.cc
0 → 100644
View file @
f286139d
#include <iostream>
#include <string>
extern
std
::
string
foo
();
int
main
()
{
std
::
cout
<<
foo
()
<<
std
::
endl
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment