diff options
author | vitalyster <vitalyster@gmail.com> | 2022-02-09 18:48:16 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-09 18:48:16 +0300 |
commit | 307232302d8c3e505d85e2147ca165d25d96d951 (patch) | |
tree | 9da4c91db2c4b7620b14e60c5734efc9c0efa075 | |
parent | 518ba5a1807fd013284d534bc020d0754ee58552 (diff) |
CI: update Windows environment (#383)
* Switched to Visual Studio 2022
* All dependencies are built by vcpkg (need to update documentation and create a repo for the build script)
* Move common classes to transport-plugin library (this fixes duplicated dll symbols issue)
* Minor CMake files cleanup
-rw-r--r-- | .github/workflows/main.yml | 6 | ||||
-rw-r--r-- | CMakeLists.txt | 5 | ||||
-rw-r--r-- | backends/libpurple/CMakeLists.txt | 2 | ||||
-rw-r--r-- | backends/template/CMakeLists.txt | 2 | ||||
-rw-r--r-- | libtransport/CMakeLists.txt | 10 | ||||
-rw-r--r-- | plugin/cpp/CMakeLists.txt | 4 | ||||
-rw-r--r-- | plugin/cpp/Config.cpp (renamed from libtransport/Config.cpp) | 0 | ||||
-rw-r--r-- | plugin/cpp/Logging.cpp (renamed from libtransport/Logging.cpp) | 0 | ||||
-rw-r--r-- | plugin/cpp/MemoryUsage.cpp (renamed from libtransport/MemoryUsage.cpp) | 0 | ||||
-rw-r--r-- | plugin/cpp/Util.cpp (renamed from libtransport/Util.cpp) | 0 |
10 files changed, 12 insertions, 17 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 75d0eb14..f3b2003b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -69,7 +69,7 @@ jobs: windows: - runs-on: windows-latest + runs-on: windows-2022 steps: - uses: actions/checkout@v2 - name: Install dependencies @@ -82,8 +82,8 @@ jobs: - name: Configure build run: | set CMAKE_PREFIX_PATH=%cd%\deps32 - set PATH=%PATH%;%cd%\deps32\bin - cmake -G "Visual Studio 16 2019" -A Win32 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_TESTS=ON -DENABLE_FROTZ=OFF -DENABLE_PURPLE=OFF -DENABLE_MYSQL=OFF -DENABLE_IRC=OFF -DENABLE_PQXX=OFF -DCMAKE_INSTALL_PREFIX=dist . + set PATH=%PATH%;%cd%\deps32\bin;%cd%\deps32\tools\bin + cmake -G "Visual Studio 17 2022" -A Win32 -DCMAKE_UNITY_BUILD=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_TESTS=ON -DENABLE_IRC=OFF -DENABLE_FROTZ=OFF -DENABLE_PURPLE=OFF -DENABLE_MYSQL=OFF -DENABLE_PQXX=OFF -DCMAKE_INSTALL_PREFIX=dist . shell: cmd - name: Build solution run: msbuild /t:Build INSTALL.vcxproj /p:Configuration=RelWithDebInfo /p:Platform=Win32 /m diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f35a451..f46acf2e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -237,13 +237,8 @@ message("Version : " ${SPECTRUM_VERSION}) if(SQLITE3_FOUND) add_definitions(-DWITH_SQLITE) -if(WIN32) - include_directories("${CMAKE_SOURCE_DIR}/msvc-deps/sqlite3") - message("SQLite3 : bundled") -else(WIN32) include_directories(${SQLITE3_INCLUDE_DIR}) message("SQLite3 : yes") -endif(WIN32) else(SQLITE3_FOUND) set(SQLITE3_LIBRARIES "") if(ENABLE_SQLITE3) diff --git a/backends/libpurple/CMakeLists.txt b/backends/libpurple/CMakeLists.txt index 7b9f4145..c62f4978 100644 --- a/backends/libpurple/CMakeLists.txt +++ b/backends/libpurple/CMakeLists.txt @@ -3,7 +3,7 @@ file(GLOB SRC *.cpp) add_executable(spectrum2_libpurple_backend ${SRC}) if(MSVC) - target_link_libraries(spectrum2_libpurple_backend transport ${PURPLE_LIBRARY} ${GLIB2_LIBRARIES} ${LIBXML2_LIBRARIES} ${EVENT_LIBRARIES} transport-plugin ${PROTOBUF_LIBRARY}) + target_link_libraries(spectrum2_libpurple_backend transport ${PURPLE_LIBRARY} ${GLIB2_LIBRARIES} ${LIBXML2_LIBRARIES} ${EVENT_LIBRARIES} transport-plugin) else() if(NOT WIN32) target_link_libraries(spectrum2_libpurple_backend transport ${PURPLE_LIBRARY} ${GLIB2_LIBRARIES} ${EVENT_LIBRARIES} transport-plugin pthread) diff --git a/backends/template/CMakeLists.txt b/backends/template/CMakeLists.txt index 26fcde1b..37828416 100644 --- a/backends/template/CMakeLists.txt +++ b/backends/template/CMakeLists.txt @@ -9,7 +9,7 @@ if(CMAKE_COMPILER_IS_GNUCXX) target_link_libraries(spectrum2_template_backend transport ${Boost_LIBRARIES} ${SWIFTEN_LIBRARY} ${LOG4CXX_LIBRARIES}) endif() else() - target_link_libraries(spectrum2_template_backend transport ${PROTOBUF_LIBRARY} ${Boost_LIBRARIES} ${SWIFTEN_LIBRARY} ${LOG4CXX_LIBRARIES}) + target_link_libraries(spectrum2_template_backend transport ${Boost_LIBRARIES} ${SWIFTEN_LIBRARY} ${LOG4CXX_LIBRARIES}) endif() #install(TARGETS spectrum2_template_backend RUNTIME DESTINATION bin) diff --git a/libtransport/CMakeLists.txt b/libtransport/CMakeLists.txt index 2e49ca93..ad81c906 100644 --- a/libtransport/CMakeLists.txt +++ b/libtransport/CMakeLists.txt @@ -44,10 +44,14 @@ endif(PROTOBUF_FOUND) find_package(CURL) +target_link_libraries(transport transport-plugin ${CURL_LIBRARIES} ${SQLITE3_LIBRARIES} ${MYSQL_LIBRARIES} ${SWIFTEN_LIBRARY} ${LOG4CXX_LIBRARIES} ${POPT_LIBRARY} ${PROTOBUF_LIBRARY} JsonCpp::JsonCpp) + if(WIN32) - target_link_libraries(transport transport-plugin ${PQXX_LIBRARIES} ${CURL_LIBRARIES} ${PQ_LIBRARY} ${MYSQL_LIBRARIES} ${SWIFTEN_LIBRARY} ${LOG4CXX_LIBRARIES} ${PROTOBUF_LIBRARY} JsonCpp::JsonCpp psapi.lib bcrypt.lib) -else() - target_link_libraries(transport transport-plugin ${PQXX_LIBRARIES} ${CURL_LIBRARIES} ${PQ_LIBRARY} ${SQLITE3_LIBRARIES} ${MYSQL_LIBRARIES} ${SWIFTEN_LIBRARY} ${LOG4CXX_LIBRARIES} ${POPT_LIBRARY} ${PROTOBUF_LIBRARY} JsonCpp::JsonCpp) + target_link_libraries(transport psapi.lib bcrypt.lib) +endif() + +if(PQXX_FOUND) + target_link_libraries(transport ${PQXX_LIBRARIES} ${PQ_LIBRARY}) endif() set_target_properties(transport PROPERTIES diff --git a/plugin/cpp/CMakeLists.txt b/plugin/cpp/CMakeLists.txt index 34b2ba72..9b67e88b 100644 --- a/plugin/cpp/CMakeLists.txt +++ b/plugin/cpp/CMakeLists.txt @@ -1,10 +1,6 @@ file(GLOB SRC *.cpp *.h) file(GLOB HEADERS ../include/transport/*.h) -set(EXTRA_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/../../libtransport/MemoryUsage.cpp) -set(EXTRA_SOURCES ${EXTRA_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/../../libtransport/Logging.cpp) -set(EXTRA_SOURCES ${EXTRA_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/../../libtransport/Config.cpp) -set(EXTRA_SOURCES ${EXTRA_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/../../libtransport/Util.cpp) set(EXTRA_SOURCES ${EXTRA_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/../../include/transport/protocol.pb.cc) if(NOT WIN32) diff --git a/libtransport/Config.cpp b/plugin/cpp/Config.cpp index 52efed72..52efed72 100644 --- a/libtransport/Config.cpp +++ b/plugin/cpp/Config.cpp diff --git a/libtransport/Logging.cpp b/plugin/cpp/Logging.cpp index bfbeab43..bfbeab43 100644 --- a/libtransport/Logging.cpp +++ b/plugin/cpp/Logging.cpp diff --git a/libtransport/MemoryUsage.cpp b/plugin/cpp/MemoryUsage.cpp index e5383f6e..e5383f6e 100644 --- a/libtransport/MemoryUsage.cpp +++ b/plugin/cpp/MemoryUsage.cpp diff --git a/libtransport/Util.cpp b/plugin/cpp/Util.cpp index 92a79cce..92a79cce 100644 --- a/libtransport/Util.cpp +++ b/plugin/cpp/Util.cpp |