Skip to content

Commit

Permalink
cmake: set compiler options for the ftp target only
Browse files Browse the repository at this point in the history
  • Loading branch information
deniskovalchuk committed Nov 24, 2024
1 parent 0debca9 commit 394d724
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,6 @@ set(sources

source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES ${sources})

if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
add_compile_options(
# Setup warning level.
/W4
# C4100: 'identifier' : unreferenced formal parameter
/wd4100
# C4251: 'identifier' : class 'type' needs to have dll-interface to be
# used by clients of class 'type2'
/wd4251
# C4275: non DLL-interface classkey 'identifier' used as base for
# DLL-interface classkey 'identifier'
/wd4275)
endif()

add_library(ftp ${sources})
add_library(ftp::ftp ALIAS ftp)

Expand All @@ -101,6 +87,21 @@ target_include_directories(ftp

target_compile_features(ftp PUBLIC cxx_std_17)

if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(ftp
PRIVATE
# Setup warning level.
/W4
# C4100: 'identifier' : unreferenced formal parameter
/wd4100
# C4251: 'identifier' : class 'type' needs to have dll-interface to be
# used by clients of class 'type2'
/wd4251
# C4275: non DLL-interface classkey 'identifier' used as base for
# DLL-interface classkey 'identifier'
/wd4275)
endif()

include(GenerateExportHeader)
generate_export_header(ftp
EXPORT_FILE_NAME ${CMAKE_CURRENT_SOURCE_DIR}/include/ftp/export.hpp)
Expand Down

0 comments on commit 394d724

Please sign in to comment.