Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
CMake: remove getopt checking code, time_tool no longer requires it
  • Loading branch information
Sarcasm committed Nov 30, 2017
1 parent 93f3459 commit 9fd5fdb
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions CMakeLists.txt
Expand Up @@ -7,7 +7,6 @@ set(CMAKE_MODULE_PATH
${PROJECT_SOURCE_DIR}/cmake/modules
${CMAKE_MODULE_PATH})

include(CheckCXXSymbolExists)
include(CTest)
include(FeatureSummary)

Expand Down Expand Up @@ -82,19 +81,9 @@ add_library(cctz::cctz ALIAS cctz)

target_include_directories(cctz PUBLIC include)

# the getopt_long function used by time_tool is not available on all platforms,
# for example this is not available by default on Windows
if (NOT DEFINED HAVE_GETOPT_LONG)
set(show_time_tool_msg 1)
endif()
check_cxx_symbol_exists(getopt_long getopt.h HAVE_GETOPT_LONG)
if (HAVE_GETOPT_LONG)
add_executable(time_tool src/time_tool.cc)
cctz_target_set_cxx_standard(time_tool)
target_link_libraries(time_tool cctz::cctz)
elseif(show_time_tool_msg)
message(STATUS "Disable time_tool as getopt_long is not available")
endif()
add_executable(time_tool src/time_tool.cc)
cctz_target_set_cxx_standard(time_tool)
target_link_libraries(time_tool cctz::cctz)

if (BUILD_EXAMPLES)
add_subdirectory(examples)
Expand Down

0 comments on commit 9fd5fdb

Please sign in to comment.