1 cmake_minimum_required(VERSION 3.8...3.25)
5 set(BUILD_SHARED_LIBS OFF)
6 set(CMAKE_VISIBILITY_INLINES_HIDDEN TRUE)
7 set(CMAKE_CXX_VISIBILITY_PRESET "hidden")
10 if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5)
14 if (NOT BROKEN_LTO AND CMAKE_VERSION VERSION_GREATER "3.8")
16 include(CheckIPOSupported)
17 check_ipo_supported(RESULT HAVE_IPO)
19 set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
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)