-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix "undefined reference to `fmt::v7::detail::basic_data<void>::digits'"
Remove unused FMT_EXTERN_TEMPLATE_API
- Loading branch information
Showing
6 changed files
with
62 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
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") | ||
|
||
if (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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include <fmt/compile.h> | ||
|
||
__attribute__((visibility("default"))) | ||
std::string foo() | ||
{ | ||
return fmt::format(FMT_COMPILE("foo bar {}"), 4242); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include <string> | ||
#include <iostream> | ||
|
||
extern std::string foo(); | ||
|
||
int main() | ||
{ | ||
std::cout << foo() << std::endl; | ||
} |