Skip to content

Commit

Permalink
try add program_options
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Sep 10, 2018
1 parent 04537e9 commit 927f39f
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 19 deletions.
5 changes: 4 additions & 1 deletion Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ OS ?= $(shell uname -s)
MSYSROOT := D:/Applications/msys64
INCLUDES := -I ../include
INCLUDES += -I $(MSYSROOT)/mingw64/include
# INCLUDES += -I $(MSYSROOT)/mingw64/include/c++/8.2.0
LDFLAGS += -L"$(MSYSROOT)/mingw64/lib"

CXXSTD := --std=c++14
CXXWARNFLAGS := -Wall -Wold-style-cast -Wundef -Wsign-compare -Wconversion -Wpointer-arith -pedantic
# CXXWARNFLAGS := -Wall -Wold-style-cast -Wundef -Wsign-compare -Wconversion -Wpointer-arith -pedantic
CXXFLAGS := $(CXXSTD) $(CXXWARNFLAGS) -g -O2 $(INCLUDES)

# prefix := /usr
Expand Down
40 changes: 24 additions & 16 deletions csar.sublime-project
Original file line number Diff line number Diff line change
@@ -1,39 +1,47 @@
{
"build_systems": [
"build_systems":
[
{
"name": "MS Build",
"cmd": ["C:\\Program Files (x86)\\MSBuild\\14.0\\Bin\\MSBuild.exe", "MSBuildMakefile.xml"],
"encoding": "gb2312"
"cmd":
[
"C:\\Program Files (x86)\\MSBuild\\14.0\\Bin\\MSBuild.exe",
"MSBuildMakefile.xml"
],
"encoding": "gb2312",
"name": "MS Build"
}
],
"folders":
[
{
"path": "."
},
{
"path": "D:\\Applications\\msys64\\mingw64\\include\\boost\\program_options"
}
],
"settings":
"settings":
{
"env_file":
{
"Windows": "%HOME%/Documents/myEnv.bat",
"Darwin": "~/Documents/myEnv.sh",
"Linux": "~/Documents/myEnv.sh"
},
"env":
{
"Windows":
"Darwin":
{
"PATH": "%PATH%;C:\\Program Files (x86)\\MSBuild\\14.0\\Bin"
"PATH": "$PATH:~/Documents/MyTool"
},
"Darwin":
"Linux":
{
"PATH": "$PATH:~/Documents/MyTool"
},
"Linux":
"Windows":
{
"PATH": "$PATH:~/Documents/MyTool"
"PATH": "%PATH%;C:\\Program Files (x86)\\MSBuild\\14.0\\Bin"
}
},
"env_file":
{
"Darwin": "~/Documents/myEnv.sh",
"Linux": "~/Documents/myEnv.sh",
"Windows": "%HOME%/Documents/myEnv.bat"
}
}
}
4 changes: 2 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ NAME := csar
STATIC_LIB := lib$(NAME).a

SHARED_LIB_VERSIONED := lib$(NAME).dll
override LDFLAGS += --shared
LDLIBS :=
override LDFLAGS += --shared
LDLIBS := -lboost_program_options-mt

STATIC_EXE := $(NAME).exe

Expand Down
4 changes: 4 additions & 0 deletions src/csar.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
#include <iostream>
#include <exception>
#include <boost/program_options/cmdline.hpp>
#include <boost/program_options/options_description.hpp>

struct NotImplementedError: public std::exception
{
};


int main(int argc, char const *argv[])
{
using options_description = boost::program_options::options_description;
// options_description desc("Allowed options:");
std::cout << "Hello world!" << std::endl;
return 0;
}

0 comments on commit 927f39f

Please sign in to comment.