Skip to content

Commit

Permalink
allow static linking
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Diemand <codieplusplus@apax.net>
  • Loading branch information
CodiePP committed Dec 18, 2023
1 parent 337e7af commit ff09370
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
11 changes: 7 additions & 4 deletions build/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

cmake_minimum_required(VERSION 3.5)

cmake_policy(SET CMP0074 NEW)

IF(DEFINED CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING
"Choose the type of build, options are:
Expand Down Expand Up @@ -42,6 +44,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

find_package(PkgConfig)
find_package(ZLIB)

if(NOT CMAKE_CROSSCOMPILING)
find_program(CPPCHECK NAMES cppcheck)
Expand Down Expand Up @@ -73,28 +76,28 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
find_program (SELECTED_AR NAMES ar PATHS /opt/homebrew/opt/binutils/bin /opt/homebrew/ NO_DEFAULT_PATH REQUIRED)
message(STATUS "Selected: ar in " ${SELECTED_AR})
set(LIB_PREFIX "lib")
set(libs "dl" "z")
set(libs "dl" ${ZLIB_LIBRARIES})
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")

IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
IF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "AMD64")
set(PROCESSOR_TYPE "x86_64")
ENDIF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "AMD64")
set(LIB_PREFIX "lib")
set(libs "z")
set(libs ${ZLIB_LIBRARIES})
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")

IF(${CMAKE_HOST_SYSTEM_NAME} MATCHES "FreeBSD")
set(SELECTED_AR "/usr/local/bin/ar")
ENDIF(${CMAKE_HOST_SYSTEM_NAME} MATCHES "FreeBSD")
IF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
set(LIB_PREFIX "lib")
set(libs "dl" "z")
set(libs "dl" ${ZLIB_LIBRARIES})
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")

IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(LIB_PREFIX "lib")
set(libs "dl" "z")
set(libs "dl" ${ZLIB_LIBRARIES})
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")

IF(${CMAKE_CROSSCOMPILING})
Expand Down
6 changes: 3 additions & 3 deletions test/cpp/utMain.cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Copyright (C) 2018 Alexander Diemand

// Boost link dynamically

#ifndef BOOST_ALL_DYN_LINK
#define BOOST_ALL_DYN_LINK
#endif
//#ifndef BOOST_ALL_DYN_LINK
//#define BOOST_ALL_DYN_LINK
//#endif

// Boost test main entry point

Expand Down

0 comments on commit ff09370

Please sign in to comment.