[bungee] Added new port by JoergAtGithub · Pull Request #50120 · microsoft/vcpkg
Comment on lines +9 to +20
| -#include <unistd.h> | ||
| +#if defined(_WIN32) | ||
| +#include<io.h> | ||
| +#include<process.h> | ||
| +#ifndef STDERR_FILENO | ||
| +#define STDERR_FILENO 2 | ||
| +#endif | ||
| +#define getpid _getpid | ||
| +#define write _write | ||
| +#else | ||
| +#include<unistd.h> | ||
| +#endif |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the usual space between #include and <...>, the patch would look more familiar, and also express clearly that it conditionally replaces #include <unistd.h> instead of given them impression of removing it.
Comment on lines +14 to +18
| if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") | ||
| set(BUNGEE_BUILD_SHARED_LIBRARY ON) | ||
| else() | ||
| set(BUNGEE_BUILD_SHARED_LIBRARY OFF) | ||
| endif() |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Popular one-liner:
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUNGEE_BUILD_SHARED_LIBRARY)
Comment on lines +27 to +37
| set(BUNGEE_MSVC_PDB_OPTIONS | ||
| -DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=ProgramDatabase | ||
| -DCMAKE_C_FLAGS_DEBUG=/Zi | ||
| -DCMAKE_CXX_FLAGS_DEBUG=/Zi | ||
| -DCMAKE_SHARED_LINKER_FLAGS_DEBUG=/DEBUG | ||
| -DCMAKE_EXE_LINKER_FLAGS_DEBUG=/DEBUG | ||
| -DCMAKE_C_FLAGS_RELEASE=/Zi | ||
| -DCMAKE_CXX_FLAGS_RELEASE=/Zi | ||
| -DCMAKE_SHARED_LINKER_FLAGS_RELEASE=/DEBUG | ||
| -DCMAKE_EXE_LINKER_FLAGS_RELEASE=/DEBUG | ||
| ) |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This overrides (user) toolchain choices and usually shouldn't be done by ports.
Comment on lines +20 to +23
| set(BUNGEE_INSTALL_FRAMEWORK OFF) | ||
| if(VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_IOS) | ||
| set(BUNGEE_INSTALL_FRAMEWORK ON) | ||
| endif() |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vcpkg usually wants regular libs, not frameworks.
Comment on lines +54 to +63
| +if (BUNGEE_BUILD_SHARED_LIBRARY) | ||
| + # Bungee command-line executable target: "bungee_executable" | ||
| + add_executable(bungee_executable cmd/main.cpp) | ||
| + target_include_directories(bungee_executable PRIVATE .) | ||
| + target_link_libraries(bungee_executable PRIVATE bungee_library cxxopts::cxxopts) | ||
| + set_target_properties(bungee_executable PROPERTIES | ||
| + OUTPUT_NAME bungee | ||
| + INSTALL_RPATH "${CMAKE_INSTALL_RPATH};${CMAKE_INSTALL_PREFIX}" | ||
| + ) | ||
| +endif() |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Building the exe only for shared libs is surprising.
Comment on lines +97 to +99
| -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libbungee.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libbungee.pc @ONLY) | ||
|
|
||
| -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libbungee.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/${BUNGEE_PRESET}/pkgconfig) |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this moved elsewhere now? I fail to spot it.