comparison dep/fmt/test/static-export-test/CMakeLists.txt @ 343:1faa72660932

*: transfer back to cmake from autotools autotools just made lots of things more complicated than they should have and many things broke (i.e. translations)
author Paper <paper@paper.us.eu.org>
date Thu, 20 Jun 2024 05:56:06 -0400
parents
children
comparison
equal deleted inserted replaced
342:adb79bdde329 343:1faa72660932
1 cmake_minimum_required(VERSION 3.8...3.25)
2
3 project(fmt-link CXX)
4
5 set(BUILD_SHARED_LIBS OFF)
6 set(CMAKE_VISIBILITY_INLINES_HIDDEN TRUE)
7 set(CMAKE_CXX_VISIBILITY_PRESET "hidden")
8
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 ()
13
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 ()
22
23 add_subdirectory(../.. fmt)
24 set_property(TARGET fmt PROPERTY POSITION_INDEPENDENT_CODE ON)
25
26 add_library(library-test SHARED library.cc)
27 target_link_libraries(library-test PRIVATE fmt::fmt)
28
29 add_executable(exe-test main.cc)
30 target_link_libraries(exe-test PRIVATE library-test)