Skip to content

Commit 89d0e69

Browse files
authored
Merge pull request #79 from Magisus/more-boost
(maint) Fix linking errors on AIX, Solaris, Cisco, and Windows
2 parents 7b000ec + 846e4d6 commit 89d0e69

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

CMakeLists.txt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,24 @@ include(options)
2828
include(cflags)
2929
set(${PROJECT_NAME_UPPER}_CXX_FLAGS "${LEATHERMAN_CXX_FLAGS}")
3030
add_definitions(${LEATHERMAN_DEFINITIONS})
31-
add_definitions(-DLEATHERMAN_I18N)
31+
32+
if(LEATHERMAN_USE_LOCALES)
33+
add_definitions(-DLEATHERMAN_I18N)
34+
endif()
35+
3236
## Pull in helper macros for working with leatherman libraries
3337
include(leatherman)
3438

39+
if(LEATHERMAN_USE_LOCALES)
40+
set(BOOST_COMPONENTS locale)
41+
else()
42+
set(BOOST_COMPONENTS regex)
43+
endif()
44+
45+
list(APPEND BOOST_COMPONENTS thread date_time chrono system program_options)
46+
3547
# Add other dependencies
36-
find_package(Boost 1.54 REQUIRED COMPONENTS locale thread date_time chrono system program_options)
48+
find_package(Boost 1.54 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
3749

3850
# pthreads if you require the Boost.Thread component.
3951
find_package(Threads)

lib/tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ target_link_libraries(lib${PROJECT_NAME}_test
3030
${CMAKE_THREAD_LIBS_INIT}
3131
)
3232

33-
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND BOOST_STATIC)
33+
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND BOOST_STATIC AND LEATHERMAN_USE_LOCALES)
3434
target_link_libraries(lib${PROJECT_NAME}_test iconv)
3535
endif()
3636

0 commit comments

Comments
 (0)