Skip to content

Commit

Permalink
Restore Win build compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
tedwaine authored and mpkepic committed Jul 19, 2024
1 parent 47dfc99 commit 7a3818f
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 25 deletions.
18 changes: 9 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,6 @@ if(WIN32)
# https://github.com/nlohmann/json/issues/3868#issuecomment-1563726354
add_definitions(-DJSON_HAS_THREE_WAY_COMPARISON=OFF)

# build quickpromise
add_subdirectory("extern/quickpromise")
add_subdirectory("extern/quickfuture")

set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)

# When moving to Qt6 or greater, we might be able to use qt_generate_deploy_app_script
Expand Down Expand Up @@ -229,6 +225,15 @@ endif()
add_subdirectory(src)

if(INSTALL_XSTUDIO)


# add extern libs that are build-time dependencies of xstudio
if (UNIX)
add_subdirectory("extern/reproc")
endif()
add_subdirectory("extern/quickfuture")
add_subdirectory("extern/quickpromise")

add_subdirectory(share/preference)
add_subdirectory(share/snippets)
add_subdirectory(share/fonts)
Expand Down Expand Up @@ -272,11 +277,6 @@ if(INSTALL_XSTUDIO)

endif ()

# add extern libs that are build-time dependencies of xstudio
add_subdirectory("extern/reproc")
add_subdirectory("extern/quickfuture")
add_subdirectory("extern/quickpromise")

if(USE_VCPKG)
# To provide reliable ordering, we need to make this install script happen in a subdirectory.
# Otherwise, Qt deploy will happen before we have the rest of the application deployed.
Expand Down
2 changes: 1 addition & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/build/vcpkg/scripts/buildsystems/vcpkg.cmake",
"Qt5_DIR": "C:/Qt/5.15.2/msvc2019_64/lib/cmake/Qt5/",
"CMAKE_INSTALL_PREFIX": "D:/xstudio_install",
"CMAKE_INSTALL_PREFIX": "C:/xstudio_install3",
"X_VCPKG_APPLOCAL_DEPS_INSTALL": "ON",
"BUILD_DOCS": "OFF"
}
Expand Down
2 changes: 2 additions & 0 deletions cmake/macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ macro(default_compile_options name)
# PRIVATE -fvisibility=hidden
PRIVATE $<$<AND:$<CONFIG:RelWithDebInfo>,$<PLATFORM_ID:Linux>>:-fno-omit-frame-pointer>
PRIVATE $<$<AND:$<CONFIG:RelWithDebInfo>,$<PLATFORM_ID:Windows>>:/Oy>
PRIVATE $<$<AND:$<CONFIG:RelWithDebInfo>,$<PLATFORM_ID:Windows>>:/showIncludes>
# PRIVATE $<$<CONFIG:Debug>:-Wno-unused-variable>
# PRIVATE $<$<CONFIG:Debug>:-Wno-unused-but-set-variable>
# PRIVATE $<$<CONFIG:Debug>:-Wno-unused-parameter>
Expand Down Expand Up @@ -32,6 +33,7 @@ macro(default_compile_options name)
PUBLIC BINARY_DIR=\"${CMAKE_BINARY_DIR}/bin\"
PRIVATE TEST_RESOURCE=\"${TEST_RESOURCE}\"
PRIVATE ROOT_DIR=\"${ROOT_DIR}\"
$<$<PLATFORM_ID:Windows>:WIN32_LEAN_AND_MEAN>
PRIVATE $<$<CONFIG:Debug>:XSTUDIO_DEBUG=1>
)
endmacro()
Expand Down
2 changes: 1 addition & 1 deletion extern/include/cpp-httplib/httplib.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ using ssize_t = long;
#endif // NOMINMAX

#include <io.h>
#include <winsock2.h>
//#include <winsock2.h>
#include <ws2tcpip.h>

#ifndef WSA_FLAG_NO_HANDLE_INHERIT
Expand Down
3 changes: 2 additions & 1 deletion extern/include/stduuid/uuid.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
#ifdef _WIN32
#include <objbase.h>

#define WIN32_LEAN_AND_MEAN
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>
#include <intrin.h>
#include <iphlpapi.h>
Expand Down
13 changes: 7 additions & 6 deletions extern/quickfuture/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ set(QML_FILES
src/quickfuture.qmltypes
)

set_target_properties(quickfuture
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/plugin/qml/QuickFuture"
)

if(WIN32)
install(FILES ${QML_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/plugin/qml/QuickFuture)
install(TARGETS quickfuture LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/plugin/qml/QuickFuture)
install(TARGETS quickfuture RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/plugin/qml)
else()

set_target_properties(quickfuture
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/plugin/qml/QuickFuture"
)

install(FILES ${QML_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/xstudio/plugin/qml/QuickFuture)
install(TARGETS quickfuture LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/share/xstudio/plugin/qml/QuickFuture)

Expand Down
3 changes: 2 additions & 1 deletion extern/stduuid/include/uuid.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
#ifdef _WIN32
#include <objbase.h>

#define WIN32_LEAN_AND_MEAN
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>
#include <intrin.h>
#include <iphlpapi.h>
Expand Down
1 change: 0 additions & 1 deletion include/xstudio/utility/helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "xstudio/utility/string_helpers.hpp"
#include "xstudio/caf_error.hpp"
#include "xstudio/caf_utility/caf_setup.hpp"

#ifdef _WIN32
#include <windows.h>
#include <fmt/format.h>
Expand Down
1 change: 1 addition & 0 deletions include/xstudio/utility/string_helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#ifdef _WIN32
#include <winsock2.h>
#endif

#include <filesystem>
#include <algorithm>
#include <cctype>
Expand Down
1 change: 0 additions & 1 deletion src/audio/src/windows_audio_output_device.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <Audioclient.h>
#include <atlbase.h>
Expand Down
2 changes: 1 addition & 1 deletion src/python_module/src/py_messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// #include <caf/all.hpp>
// #include <caf/config.hpp>
// #include <caf/io/all.hpp>
#include "xstudio/utility/helpers.hpp"

#include "py_opaque.hpp"

Expand All @@ -15,7 +16,6 @@
#include "xstudio/ui/mouse.hpp"
#include "xstudio/utility/caf_helpers.hpp"
#include "xstudio/utility/container.hpp"
#include "xstudio/utility/helpers.hpp"
#include "xstudio/utility/media_reference.hpp"
#include "xstudio/utility/remote_session_file.hpp"
#include "xstudio/utility/serialise_headers.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/timeline/src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#include <algorithm>
#include <nlohmann/json.hpp>

#include "xstudio/timeline/item.hpp"
#include "xstudio/utility/helpers.hpp"
#include "xstudio/timeline/item.hpp"

using namespace xstudio;
using namespace xstudio::timeline;
Expand Down
3 changes: 2 additions & 1 deletion src/utility/src/frame_list.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
#include "xstudio/utility/helpers.hpp"

#include <filesystem>

#include <limits>
Expand All @@ -7,7 +9,6 @@
#include <fmt/format.h>

#include "xstudio/utility/frame_list.hpp"
#include "xstudio/utility/helpers.hpp"
#include "xstudio/utility/logging.hpp"
#include "xstudio/utility/string_helpers.hpp"

Expand Down
3 changes: 2 additions & 1 deletion src/utility/src/helpers.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
#include "xstudio/utility/helpers.hpp"

#ifdef __linux__
#define __USE_POSIX
#include <unistd.h>
Expand All @@ -18,7 +20,6 @@
//#include <reproc++/reproc.hpp>

#include "xstudio/utility/frame_list.hpp"
#include "xstudio/utility/helpers.hpp"
#include "xstudio/utility/sequence.hpp"
#include "xstudio/utility/string_helpers.hpp"

Expand Down

0 comments on commit 7a3818f

Please sign in to comment.