Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various fixes, windows build fixes, and cmake+CI improvements #89

Merged
merged 9 commits into from
Nov 24, 2024
136 changes: 0 additions & 136 deletions .cmake/FindIconv.cmake

This file was deleted.

4 changes: 2 additions & 2 deletions .cmake/configure_and_install_pc_file.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
function(configure_and_install_pc_file name version)
set(prefix "${CMAKE_INSTALL_PREFIX}")
set(exec_prefix "\${prefix}")
set(libdir "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
set(includedir "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}")
set(libdir "\${prefix}/${CMAKE_INSTALL_LIBDIR}")
set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
set(VERSION "${version}")

configure_file(${name}.pc.in ${PROJECT_BINARY_DIR}/${name}.pc @ONLY)
Expand Down
52 changes: 52 additions & 0 deletions .cmake/create_lib_target_with_deps.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
function(create_lib_target_with_deps lib)
add_library(${lib} ${SRC_FILES})

include(CheckIPOSupported)
check_ipo_supported(RESULT lto_supported OUTPUT error)
if(lto_supported)
set_target_properties(${lib} PROPERTIES
INTERPROCEDURAL_OPTIMIZATION_DEBUG FALSE
INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE
INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO TRUE
)
else()
message(STATUS "IPO/LTO not supported: <${error}>")
endif()

# Internal deps
foreach(idep ${ARGN})
add_dependencies(${lib} ${idep})
if(${idep} MATCHES "^(ti[a-z]+)2$")
set(INTERNAL_DEP_LIB_DIR ${PROJECT_BINARY_DIR}/../../lib${CMAKE_MATCH_1}/trunk)
set(INTERNAL_DEP_INC_DIR ${PROJECT_SOURCE_DIR}/../../lib${CMAKE_MATCH_1}/trunk/src)
else()
set(INTERNAL_DEP_LIB_DIR ${PROJECT_BINARY_DIR}/../../lib${idep}/trunk)
set(INTERNAL_DEP_INC_DIR ${PROJECT_SOURCE_DIR}/../../lib${idep}/trunk/src)
endif()
if(GEN_IS_MULTI_CONFIG)
set(INTERNAL_DEP_LIB_DIR "${INTERNAL_DEP_LIB_DIR}/$<CONFIG>")
endif()
target_include_directories(${lib} PRIVATE ${INTERNAL_DEP_INC_DIR})
if (BUILD_SHARED_LIBS)
target_link_directories(${lib} PRIVATE "${INTERNAL_DEP_LIB_DIR}")
target_link_libraries(${lib} PRIVATE ${idep})
else()
target_link_libraries(${lib} PRIVATE "${INTERNAL_DEP_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${idep}${CMAKE_STATIC_LIBRARY_SUFFIX}")
endif()
endforeach()

# Main properties
set_target_properties(${lib} PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}")

# Defines
target_compile_definitions(${lib} PRIVATE PACKAGE="${PROJECT_NAME}" VERSION="${PROJECT_VERSION}")

# Stuff to install and developer-related things
install(TARGETS ${lib}
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/tilp2")

configure_and_install_pc_file(${lib} ${PROJECT_VERSION})
endfunction()
74 changes: 0 additions & 74 deletions .cmake/create_targets_both_lib_types.cmake

This file was deleted.

95 changes: 0 additions & 95 deletions .cmake/try_static_libs.cmake

This file was deleted.

8 changes: 8 additions & 0 deletions .cmake/vcpkg_overlay_triplets/x64-linux-dynamic-release.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)

set(VCPKG_CMAKE_SYSTEM_NAME Linux)
set(VCPKG_BUILD_TYPE release)

set(VCPKG_FIXUP_ELF_RPATH ON)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set(VCPKG_TARGET_ARCHITECTURE x86)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_BUILD_TYPE release)
Loading
Loading