From 72697cfb4f7cfa8e82cba4960ac9e8c729c3b24d Mon Sep 17 00:00:00 2001 From: Tycho Date: Fri, 7 Mar 2014 11:23:28 -0800 Subject: Added support to overide CMake build type with env vars --- src/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5029906aa..cafa519c3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -9,6 +9,14 @@ include_directories (SYSTEM "${PROJECT_SOURCE_DIR}/../lib/polarssl/include") set(FOLDERS OSSupport HTTPServer Items Blocks Protocol Generating) set(FOLDERS ${FOLDERS} WorldStorage Mobs Entities Simulator UI BlockEntities) +if(DEFINED ENV{MCSERVER_BUILD_TYPE}) + message("Setting build type to $ENV{MCSERVER_BUILD_TYPE}") + set(CMAKE_BUILD_TYPE $ENV{MCSERVER_BUILD_TYPE}) +endif() + +if(DEFINED ENV{MCSERVER_FORCE32}) + set(FORCE32 $ENV{MCSERVER_FORCE32}) +endif() if (NOT MSVC) -- cgit v1.2.3 From 53fe82eaf85dc3bcd2cfdc12ffb2266e10f91e79 Mon Sep 17 00:00:00 2001 From: Tycho Date: Fri, 7 Mar 2014 11:26:36 -0800 Subject: Added travis support for multiple build types --- .travis.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c6537cf47..a12ca55e0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,13 @@ compiler: - gcc - clang # Build MCServer -script: cmake . -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_TOOLS=1 -DSELF_TEST=1 && make -j 2 && cd MCServer/ && (echo stop | ./MCServer) +script: cmake . -DBUILD_TOOLS=1 -DSELF_TEST=1 && make -j 2 && cd MCServer/ && (echo stop | ./MCServer) + +env: + - MCSERVER_BUILD_TYPE=RELEASE + - MCSERVER_BUILD_TYPE=DEBUG + - MCSERVER_BUILD_TYPE=RELEASE MCSERVER_FORCE32=1 + - MCSERVER_BUILD_TYPE=DEBUG MCSERVER_FORCE32=1 # Notification Settings notifications: -- cgit v1.2.3 From 6b153a5014612a998179f4637139061ed11da6db Mon Sep 17 00:00:00 2001 From: worktycho Date: Fri, 7 Mar 2014 19:59:49 +0000 Subject: Move env code part 1 --- src/CMakeLists.txt | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cafa519c3..c2de26664 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,3 @@ - cmake_minimum_required (VERSION 2.8.2) project (MCServer) @@ -9,15 +8,6 @@ include_directories (SYSTEM "${PROJECT_SOURCE_DIR}/../lib/polarssl/include") set(FOLDERS OSSupport HTTPServer Items Blocks Protocol Generating) set(FOLDERS ${FOLDERS} WorldStorage Mobs Entities Simulator UI BlockEntities) -if(DEFINED ENV{MCSERVER_BUILD_TYPE}) - message("Setting build type to $ENV{MCSERVER_BUILD_TYPE}") - set(CMAKE_BUILD_TYPE $ENV{MCSERVER_BUILD_TYPE}) -endif() - -if(DEFINED ENV{MCSERVER_FORCE32}) - set(FORCE32 $ENV{MCSERVER_FORCE32}) -endif() - if (NOT MSVC) -- cgit v1.2.3 From c67e008a4e3c19a79f82af4d430e43e6ea0eabbf Mon Sep 17 00:00:00 2001 From: worktycho Date: Fri, 7 Mar 2014 20:03:05 +0000 Subject: Fixed wrong path in debug mode --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index a12ca55e0..14dad4df4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,13 +3,13 @@ compiler: - gcc - clang # Build MCServer -script: cmake . -DBUILD_TOOLS=1 -DSELF_TEST=1 && make -j 2 && cd MCServer/ && (echo stop | ./MCServer) +script: cmake . -DBUILD_TOOLS=1 -DSELF_TEST=1 && make -j 2 && cd MCServer/ && (echo stop | $MCSERVER_PATH) env: - - MCSERVER_BUILD_TYPE=RELEASE - - MCSERVER_BUILD_TYPE=DEBUG - - MCSERVER_BUILD_TYPE=RELEASE MCSERVER_FORCE32=1 - - MCSERVER_BUILD_TYPE=DEBUG MCSERVER_FORCE32=1 + - MCSERVER_BUILD_TYPE=RELEASE MCSERVER_PATH=./MCServer + - MCSERVER_BUILD_TYPE=DEBUG MCSERVER_PATH=./MCServer_debug + - MCSERVER_BUILD_TYPE=RELEASE MCSERVER_FORCE32=1 MCSERVER_PATH=./MCServer + - MCSERVER_BUILD_TYPE=DEBUG MCSERVER_FORCE32=1 MCSERVER_PATH=./MCServer_debug # Notification Settings notifications: -- cgit v1.2.3 From 0eea9eb99841ba379475a277af860d22ac156071 Mon Sep 17 00:00:00 2001 From: worktycho Date: Fri, 7 Mar 2014 20:16:16 +0000 Subject: Move env code part 2 Only just noticed I committed this on the wrong branch. --- CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 05b6d879b..e7e8daf7d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,15 @@ cmake_minimum_required (VERSION 2.6) # Without this, the MSVC variable isn't defined for MSVC builds ( http://www.cmake.org/pipermail/cmake/2011-November/047130.html ) enable_language(CXX C) +if(DEFINED ENV{MCSERVER_BUILD_TYPE}) + message("Setting build type to $ENV{MCSERVER_BUILD_TYPE}") + set(CMAKE_BUILD_TYPE $ENV{MCSERVER_BUILD_TYPE}) +endif() + +if(DEFINED ENV{MCSERVER_FORCE32}) + set(FORCE32 $ENV{MCSERVER_FORCE32}) +endif() + # This has to be done before any flags have been set up. if(${BUILD_TOOLS}) add_subdirectory(Tools/MCADefrag/) -- cgit v1.2.3 From e4c7aac1cce39822a39da6bde28ac2066c9c0026 Mon Sep 17 00:00:00 2001 From: Tycho Date: Mon, 10 Mar 2014 13:52:13 -0700 Subject: Prepended Travis to env vars --- .travis.yml | 8 ++++---- CMakeLists.txt | 12 +++++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 14dad4df4..0ab25ae3b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,10 +6,10 @@ compiler: script: cmake . -DBUILD_TOOLS=1 -DSELF_TEST=1 && make -j 2 && cd MCServer/ && (echo stop | $MCSERVER_PATH) env: - - MCSERVER_BUILD_TYPE=RELEASE MCSERVER_PATH=./MCServer - - MCSERVER_BUILD_TYPE=DEBUG MCSERVER_PATH=./MCServer_debug - - MCSERVER_BUILD_TYPE=RELEASE MCSERVER_FORCE32=1 MCSERVER_PATH=./MCServer - - MCSERVER_BUILD_TYPE=DEBUG MCSERVER_FORCE32=1 MCSERVER_PATH=./MCServer_debug + - TRAVIS_MCSERVER_BUILD_TYPE=RELEASE MCSERVER_PATH=./MCServer + - TRAVIS_MCSERVER_BUILD_TYPE=DEBUG MCSERVER_PATH=./MCServer_debug + - TRAVIS_MCSERVER_BUILD_TYPE=RELEASE TRAVIS_MCSERVER_FORCE32=1 MCSERVER_PATH=./MCServer + - TRAVIS_MCSERVER_BUILD_TYPE=DEBUG TRAVIS_MCSERVER_FORCE32=1 MCSERVER_PATH=./MCServer_debug # Notification Settings notifications: diff --git a/CMakeLists.txt b/CMakeLists.txt index e7e8daf7d..9a860920c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,13 +3,15 @@ cmake_minimum_required (VERSION 2.6) # Without this, the MSVC variable isn't defined for MSVC builds ( http://www.cmake.org/pipermail/cmake/2011-November/047130.html ) enable_language(CXX C) -if(DEFINED ENV{MCSERVER_BUILD_TYPE}) - message("Setting build type to $ENV{MCSERVER_BUILD_TYPE}") - set(CMAKE_BUILD_TYPE $ENV{MCSERVER_BUILD_TYPE}) +# These env variables are used for configuring Travis CI builds. +# See https://github.com/mc-server/MCServer/pull/767 +if(DEFINED ENV{TRAVIS_MCSERVER_BUILD_TYPE}) + message("Setting build type to $ENV{TRAVIS_MCSERVER_BUILD_TYPE}") + set(CMAKE_BUILD_TYPE $ENV{TRAVIS_MCSERVER_BUILD_TYPE}) endif() -if(DEFINED ENV{MCSERVER_FORCE32}) - set(FORCE32 $ENV{MCSERVER_FORCE32}) +if(DEFINED ENV{TRAVIS_MCSERVER_FORCE32}) + set(FORCE32 $ENV{TRAVIS_MCSERVER_FORCE32}) endif() # This has to be done before any flags have been set up. -- cgit v1.2.3