swsf-bruteforce/CMakeLists.txt

48 lines
1.1 KiB
CMake
Raw Normal View History

2023-08-21 20:50:31 -04:00
cmake_minimum_required(VERSION 3.14)
project(swsf_bruteforce
LANGUAGES C CXX
)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
include(Policies)
include(ProjectFuncs)
# required system dependencies
find_package(Threads REQUIRED)
2023-08-22 16:45:53 -04:00
find_package(Boost REQUIRED COMPONENTS system)
2023-08-21 20:50:31 -04:00
# default linker
2023-08-22 03:44:45 -04:00
if(NOT PROJECT_LINKER AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(PROJECT_LINKER "lld")
elseif(NOT PROJECT_LINKER)
set(PROJECT_LINKER "bfd")
2023-08-21 20:50:31 -04:00
endif()
2023-08-21 21:39:54 -04:00
include(FetchContent)
2023-08-22 03:44:45 -04:00
project_set_alternate_linker()
2023-08-21 20:50:31 -04:00
2023-08-22 03:44:45 -04:00
add_executable(swsf_bruteforce
2023-08-21 20:50:31 -04:00
src/asio_impl.cpp
src/main.cpp
2023-08-22 04:30:34 -04:00
src/worker.cpp
2023-08-21 20:50:31 -04:00
)
2023-08-22 03:44:45 -04:00
target_compile_definitions(swsf_bruteforce PRIVATE
# We compile Asio in a separate TU (src/asio_impl.cpp)
2023-08-21 20:50:31 -04:00
-DBOOST_ASIO_SEPARATE_COMPILATION=1
-DBOOST_ASIO_NO_DEPRECATED=1
-DBOOST_ASIO_DISABLE_BOOST_ARRAY=1
-DBOOST_ASIO_DISABLE_BOOST_BIND=1
)
2023-08-22 03:44:45 -04:00
target_compile_features(swsf_bruteforce PRIVATE cxx_std_20)
target_include_directories(swsf_bruteforce PRIVATE ${PROJECT_SOURCE_DIR}/src)
2023-08-21 20:50:31 -04:00
2023-08-22 16:45:53 -04:00
target_link_libraries(swsf_bruteforce PRIVATE
Boost::system
)
2023-08-22 03:44:45 -04:00
project_target(swsf_bruteforce)