Add 3rdparty getopt for MSVC
This commit is contained in:
@@ -1160,9 +1160,16 @@ if(WIN32)
|
||||
if(MSVC)
|
||||
target_link_libraries(strawberry_lib PRIVATE sqlite3)
|
||||
endif()
|
||||
if(MSVC)
|
||||
if (GETOPT_INCLUDE_DIRS)
|
||||
target_include_directories(strawberry_lib SYSTEM PRIVATE ${GETOPT_INCLUDE_DIRS})
|
||||
endif()
|
||||
if(GETOPT_LIBRARIES)
|
||||
target_link_libraries(strawberry_lib PRIVATE ${GETOPT_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
###############################################################################
|
||||
|
||||
set(EXECUTABLE_OUTPUT_PATH ..)
|
||||
|
||||
@@ -22,9 +22,7 @@
|
||||
#include "version.h"
|
||||
|
||||
#include <cstdlib>
|
||||
#ifndef _MSC_VER
|
||||
# include <getopt.h>
|
||||
#endif
|
||||
#include <getopt.h>
|
||||
#include <iostream>
|
||||
#include <type_traits>
|
||||
|
||||
@@ -121,7 +119,6 @@ void CommandlineOptions::RemoveArg(const QString &starts_with, int count) {
|
||||
|
||||
bool CommandlineOptions::Parse() {
|
||||
|
||||
#ifndef _MSC_VER // TODO: Consider QCommandLineOption.
|
||||
static const struct option kOptions[] = {
|
||||
{"help", no_argument, nullptr, 'h'},
|
||||
{"play", no_argument, nullptr, 'p'},
|
||||
@@ -322,8 +319,6 @@ bool CommandlineOptions::Parse() {
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _MSC_VER
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user