Skip to content

Commit

Permalink
Update Example
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSodaSea committed Feb 3, 2018
1 parent 3864ec8 commit e505fae
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 22 deletions.
34 changes: 25 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,65 @@ sudo: required

matrix:
include:
- env: EVAL="CXX=g++-5" FLAGS="-m32" CONFIG=Debug
- os: linux
env: OS=Linux EVAL="CXX=g++-5" FLAGS="-m32" CONFIG=Debug
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5-multilib', 'lib32stdc++6', 'linux-libc-dev']
- env: EVAL="CXX=g++-5" FLAGS="-m32" CONFIG=Release
- os: linux
env: OS=Linux EVAL="CXX=g++-5" FLAGS="-m32" CONFIG=Release
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5-multilib', 'lib32stdc++6', 'linux-libc-dev']
- env: EVAL="CXX=g++-5" FLAGS="-m64" CONFIG=Debug
- os: linux
env: OS=Linux EVAL="CXX=g++-5" FLAGS="-m64" CONFIG=Debug
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5']
- env: EVAL="CXX=g++-5" FLAGS="-m64" CONFIG=Release
- os: linux
env: OS=Linux EVAL="CXX=g++-5" FLAGS="-m64" CONFIG=Release
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5']
- env: EVAL="CXX=clang++" FLAGS="-m32" CONFIG=Debug
- os: linux
env: OS=Linux EVAL="CXX=clang++" FLAGS="-m32" CONFIG=Debug
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5-multilib', 'lib32stdc++6', 'linux-libc-dev']
- env: EVAL="CXX=clang++" FLAGS="-m32" CONFIG=Release
- os: linux
env: OS=Linux EVAL="CXX=clang++" FLAGS="-m32" CONFIG=Release
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5-multilib', 'lib32stdc++6', 'linux-libc-dev']
- env: EVAL="CXX=clang++" FLAGS="-m64" CONFIG=Debug
- os: linux
env: OS=Linux EVAL="CXX=clang++" FLAGS="-m64" CONFIG=Debug
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5']
- env: EVAL="CXX=clang++" FLAGS="-m64" CONFIG=Release
- os: linux
env: OS=Linux EVAL="CXX=clang++" FLAGS="-m64" CONFIG=Release
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5']
- os: osx
env: OS=MacOS EVAL="CXX=clang++" FLAGS="-m32" CONFIG=Debug
- os: osx
env: OS=MacOS EVAL="CXX=clang++" FLAGS="-m32" CONFIG=Release
- os: osx
env: OS=MacOS EVAL="CXX=clang++" FLAGS="-m64" CONFIG=Debug
- os: osx
env: OS=MacOS EVAL="CXX=clang++" FLAGS="-m64" CONFIG=Release

before_script:
- sudo ln -s /usr/include/asm-generic /usr/include/asm
- if [ "$OS" == "Linux" ]; then sudo ln -s /usr/include/asm-generic /usr/include/asm; fi
- eval "${EVAL}"
- $CXX -v
- cd ..
Expand Down
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ set(CMAKE_CXX_STANDARD 14)

if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -O2")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s -static -Wl,--no-export-dynamic")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-s")
if(WIN32)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
endif()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_SCL_SECURE_NO_WARNINGS /EHsc /W3 /O2 /MT")
endif()
Expand Down
8 changes: 2 additions & 6 deletions example/XML_DOMReader/XML_DOMReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ int main(int argc, char** argv) {
try {

if(argc < 2) throw InvalidArgumentException("File name needed");

for(int i = 1; i < argc; ++i) {

auto data = readFile(argv[i]);
Expand All @@ -61,12 +62,7 @@ int main(int argc, char** argv) {

}

} catch(std::exception& e) {

std::cerr << e.what() << std::endl;
return 1;

}
} catch(std::exception& e) { std::cerr << e.what() << std::endl; return 1; }

return 0;

Expand Down
8 changes: 2 additions & 6 deletions example/XML_SAXReader/XML_SAXReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ int main(int argc, char** argv) {
try {

if(argc < 2) throw InvalidArgumentException("File name needed");

for(int i = 1; i < argc; ++i) {

auto data = readFile(argv[i]);
Expand All @@ -120,12 +121,7 @@ int main(int argc, char** argv) {

}

} catch(std::exception& e) {

std::cerr << e.what() << std::endl;
return 1;

}
} catch(std::exception& e) { std::cerr << e.what() << std::endl; return 1; }

return 0;

Expand Down

0 comments on commit e505fae

Please sign in to comment.