diff --git a/CMakeLists.txt b/CMakeLists.txt index 508b9b2a..d7ddfcb2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,11 +1,12 @@ cmake_minimum_required(VERSION 3.25) +# Instruct CMake to search the cmake directory for include scripts. list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake) include(vcpkg) +# Tell vcpkg to use the submodule root directory as the vcpkg root, and then configure it. set(VCPKG_SUBMODULE_ROOT ${CMAKE_CURRENT_LIST_DIR}/vcpkg) - vcpkg_configure(SUBMODULE_ROOT ${VCPKG_SUBMODULE_ROOT}) project(netremote @@ -66,10 +67,6 @@ if (CMAKE_CXX_LINK_PIE_SUPPORTED) set(CMAKE_POSITION_INDEPENDENT_CODE ON) endif() -if (WERROR) - add_compile_options(-Werror) -endif() - # Set compiler specific options if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # Common options for both gcc and clang @@ -133,6 +130,10 @@ add_compile_definitions( MAGIC_ENUM_RANGE_MAX=255 ) +if (WERROR) + add_compile_options(-Werror) +endif() + add_subdirectory(protocol) add_subdirectory(src) add_subdirectory(tests)