Include fmt 11.0.2
[openal-soft.git] / fmt-11.0.2 / test / static-export-test / CMakeLists.txt
blob492194f9fe5ebce9347e7c2291d90eeb2ff69fa3
1 cmake_minimum_required(VERSION 3.8...3.25)
3 project(fmt-link CXX)
5 set(BUILD_SHARED_LIBS OFF)
6 set(CMAKE_VISIBILITY_INLINES_HIDDEN TRUE)
7 set(CMAKE_CXX_VISIBILITY_PRESET "hidden")
9 # Broken LTO on GCC 4
10 if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5)
11   set(BROKEN_LTO ON)
12 endif ()
14 if (NOT BROKEN_LTO AND CMAKE_VERSION VERSION_GREATER "3.8")
15   # CMake 3.9+
16   include(CheckIPOSupported)
17   check_ipo_supported(RESULT HAVE_IPO)
18   if (HAVE_IPO)
19     set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
20   endif ()
21 endif ()
23 add_subdirectory(../.. fmt)
24 set_property(TARGET fmt PROPERTY POSITION_INDEPENDENT_CODE ON)
26 add_library(library-test SHARED library.cc)
27 target_link_libraries(library-test PRIVATE fmt::fmt)
29 add_executable(exe-test main.cc)
30 target_link_libraries(exe-test PRIVATE library-test)