Skip to content

Commit

Permalink
Add helloworld project.
Browse files Browse the repository at this point in the history
  • Loading branch information
markaylett committed Mar 13, 2016
1 parent 55007e4 commit 5f7f499
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
21 changes: 21 additions & 0 deletions example/helloworld/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(helloworld)

IF(DEFINED ENV{SWIRLY_HOME})
MESSAGE("SWIRLY_HOME is set to $ENV{SWIRLY_HOME}")
ELSE()
MESSAGE(FATAL_ERROR "SWIRLY_HOME is not set")
ENDIF()

SET(COMMON_WARN "-Wall -Werror -Wextra -Wstrict-aliasing=2 -Wno-unused-parameter")
SET(COMMON_FLAGS "-fstrict-aliasing -fvisibility=hidden")
SET(CMAKE_CXX_FLAGS "-std=c++14 ${COMMON_FLAGS} ${COMMON_WARN} -fno-rtti")

SET(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "$ENV{SWIRLY_HOME}/etc")

FIND_PACKAGE(Swirly REQUIRED)

INCLUDE_DIRECTORIES(${SWIRLY_INCLUDE_DIRS})

ADD_EXECUTABLE(helloworld Main.cpp)
TARGET_LINK_LIBRARIES(helloworld ${SWIRLY_ASH_LIBRARY})
25 changes: 25 additions & 0 deletions example/helloworld/Main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* The Restful Matching-Engine.
* Copyright (C) 2013, 2016 Swirly Cloud Limited.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program; if
* not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
#include <swirly/ash/Log.hpp>

using namespace swirly;

int main(int argc, char* argv[])
{
SWIRLY_LOG(LogInfo, "Hello, World!");
return 0;
}

0 comments on commit 5f7f499

Please sign in to comment.