Skip to content

Commit

Permalink
Fixing windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
jholloc committed Dec 4, 2023
1 parent 0b94cdc commit ba1a7f0
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 20 deletions.
2 changes: 1 addition & 1 deletion cmake/Modules/FindTIRPC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ if( NOT TARGET TIRPC::TIRPC )
add_library( TIRPC::TIRPC INTERFACE IMPORTED )

set_target_properties( TIRPC::TIRPC PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "__TIRPC__"
INTERFACE_COMPILE_DEFINITIONS "-D__TIRPC__"
INTERFACE_INCLUDE_DIRECTORIES "${TIRPC_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${TIRPC_LIBRARIES}"
)
Expand Down
7 changes: 7 additions & 0 deletions cmake/Modules/FindXDR.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,11 @@ set_target_properties( XDR::XDR PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${XDR_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${XDR_LIBRARIES}"
)

if( WIN32 )
set_target_properties( XDR::XDR PROPERTIES
IMPORTED_LOCATION "${XDR_LIBRARIES}"
IMPORTED_IMPLIB "${XDR_LIBRARIES}"
)
endif()
endif()
2 changes: 1 addition & 1 deletion cmake/plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ macro( uda_plugin )
foreach( DEF ${PLUGIN_EXTRA_DEFINITIONS} )
add_definitions( ${DEF} )
endforeach()

set( LIBRARIES client-shared plugins-shared ${OPENSSL_LIBRARIES} )
if( ENABLE_CAPNP )
set( LIBRARIES ${LIBRARIES} serialisation-static )
Expand Down
8 changes: 4 additions & 4 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ find_package( LibXml2 REQUIRED )

if( WIN32 AND NOT MINGW )
add_compile_definitions( MINGW )
add_definitions( /W2 /WX )
add_compile_options( /W2 /WX )
else()
add_definitions( -Wall -Werror -Wextra -Wno-unused-parameter -Wno-missing-field-initializers )
add_compile_options( -Wall -Werror -Wextra -Wno-unused-parameter -Wno-missing-field-initializers )
if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 5.0 )
add_definitions( -Wno-format-truncation -Wno-format-overflow )
add_compile_options( -Wno-format-truncation -Wno-format-overflow )
if( NOT MINGW )
add_definitions( -Wno-use-after-free )
add_compile_options( -Wno-use-after-free )
endif()
endif()
endif()
Expand Down
2 changes: 1 addition & 1 deletion source/authentication/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
find_package( OpenSSL REQUIRED )
find_package( LibXml2 REQUIRED )

set( LIBS OpenSSL::SSL LibXml2::LibXml2 )
set( LIBS OpenSSL::SSL OpenSSL::Crypto LibXml2::LibXml2 )

if( WIN32 OR MINGW )
find_package( XDR REQUIRED )
Expand Down
5 changes: 2 additions & 3 deletions source/c_api/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
########################################################################################################################
# Dependencies

#find_package( OpenSSL REQUIRED )
find_package( fmt REQUIRED )
#find_package( LibXml2 REQUIRED )

set( LIBS fmt::fmt )

if( WIN32 OR MINGW )

find_package( XDR REQUIRED )
list( APPEND LIBS XDR::XDR )
else()
find_package( TIRPC QUIET )
if( TIRPC_FOUND )
Expand Down
4 changes: 2 additions & 2 deletions source/cache/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ find_package( OpenSSL REQUIRED )
find_package( LibXml2 REQUIRED )
find_package( fmt REQUIRED )

set( LIBS Boost::boost OpenSSL::SSL LibXml2::LibXml2 fmt::fmt )
set( LIBS Boost::boost OpenSSL::SSL OpenSSL::Crypto LibXml2::LibXml2 fmt::fmt )

if( WIN32 OR MINGW )
find_package( XDR REQUIRED )
Expand Down Expand Up @@ -42,5 +42,5 @@ target_include_directories( cache-objects PRIVATE
)

if( MINGW )
target_compile_definitions( cache-objects PRIVATE -Wno-format-truncation -Wno-format-overflow )
target_compile_options( cache-objects PRIVATE -Wno-format-truncation -Wno-format-overflow )
endif()
2 changes: 1 addition & 1 deletion source/client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ find_package( OpenSSL REQUIRED )
find_package( fmt REQUIRED )
find_package( LibXml2 REQUIRED )

set( LIBS OpenSSL::SSL fmt::fmt LibXml2::LibXml2 )
set( LIBS OpenSSL::SSL OpenSSL::Crypto fmt::fmt LibXml2::LibXml2 )

if( WIN32 OR MINGW )
find_package( XDR REQUIRED )
Expand Down
2 changes: 1 addition & 1 deletion source/client2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ find_package( OpenSSL REQUIRED )
find_package( LibXml2 REQUIRED )
find_package( fmt REQUIRED )

set( LIBS OpenSSL::SSL LibXml2::LibXml2 fmt::fmt )
set( LIBS OpenSSL::SSL OpenSSL::Crypto LibXml2::LibXml2 fmt::fmt )

if( WIN32 OR MINGW )
find_package( XDR REQUIRED )
Expand Down
2 changes: 1 addition & 1 deletion source/clientserver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
find_package( OpenSSL REQUIRED )
find_package( fmt REQUIRED )

set( LIBS OpenSSL::SSL fmt::fmt )
set( LIBS OpenSSL::SSL OpenSSL::Crypto fmt::fmt )

if( NOT CLIENT_ONLY )
find_package( LibXml2 REQUIRED )
Expand Down
4 changes: 2 additions & 2 deletions source/logging/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ target_include_directories( logging-server-objects PRIVATE
)

if( MINGW )
target_compile_definitions( logging-client-objects PRIVATE -Wno-error=pointer-sign )
target_compile_definitions( logging-server-objects PRIVATE -Wno-error=pointer-sign )
target_compile_options( logging-client-objects PRIVATE -Wno-error=pointer-sign )
target_compile_options( logging-server-objects PRIVATE -Wno-error=pointer-sign )
endif()
2 changes: 1 addition & 1 deletion source/server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ find_package( LibXml2 REQUIRED )
find_package( OpenSSL REQUIRED )
find_package( fmt REQUIRED )

set( LIBS LibXml2::LibXml2 OpenSSL::SSL fmt::fmt )
set( LIBS LibXml2::LibXml2 OpenSSL::SSL OpenSSL::Crypto fmt::fmt )

if( WIN32 OR MINGW )
find_package( XDR REQUIRED )
Expand Down
2 changes: 1 addition & 1 deletion source/server2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ find_package( OpenSSL REQUIRED )
find_package( spdlog REQUIRED )
find_package( fmt REQUIRED )

set( LIBS LibXml2::LibXml2 OpenSSL::SSL spdlog::spdlog fmt::fmt )
set( LIBS LibXml2::LibXml2 OpenSSL::SSL OpenSSL::Crypto spdlog::spdlog fmt::fmt )

if( WIN32 OR MINGW )
find_package( XDR REQUIRED )
Expand Down
2 changes: 1 addition & 1 deletion source/wrappers/c++/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ find_package( OpenSSL REQUIRED )
find_package( fmt REQUIRED )
find_package( LibXml2 REQUIRED )

set( LIBS Boost::boost OpenSSL::SSL fmt::fmt LibXml2::LibXml2 )
set( LIBS Boost::boost OpenSSL::SSL OpenSSL::Crypto fmt::fmt LibXml2::LibXml2 )

if( WIN32 OR MINGW )
find_package( XDR REQUIRED )
Expand Down

0 comments on commit ba1a7f0

Please sign in to comment.