summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2015-01-04 00:23:53 -0600
committerJohn Wiegley <johnw@newartisans.com>2015-01-04 00:23:53 -0600
commit599af4642c24ab8db542aec19a25c367f3ed01f8 (patch)
treee585b0322667a4cdc5f9eedf602ad45dead434b7
parentd6f194058fbf8c88b926c2cb7ed43aa4ff255bc0 (diff)
parentea397d205c84d01b8089e8fac0dd30e9100d1571 (diff)
downloadfork-ledger-599af4642c24ab8db542aec19a25c367f3ed01f8.tar.gz
fork-ledger-599af4642c24ab8db542aec19a25c367f3ed01f8.tar.bz2
fork-ledger-599af4642c24ab8db542aec19a25c367f3ed01f8.zip
Merge pull request #361 from lowdef/cygwin-build
automating ledger build on Cygwin
-rw-r--r--CMakeLists.txt6
-rwxr-xr-xacprep8
-rw-r--r--src/CMakeLists.txt14
3 files changed, 24 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ee88fe4a..30c6519e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,7 +13,11 @@ set(Ledger_VERSION_DATE 20141005)
enable_testing()
-add_definitions(-std=c++11)
+if (CYGWIN)
+ add_definitions(-std=c++11 -U__STRICT_ANSI__)
+else()
+ add_definitions(-std=c++11)
+endif()
if (CYGWIN)
add_definitions(-U__STRICT_ANSI__)
diff --git a/acprep b/acprep
index b0af2108..9e661aad 100755
--- a/acprep
+++ b/acprep
@@ -644,6 +644,9 @@ class PrepareBuild(CommandLineApp):
]
self.log.info('Executing: ' + ' '.join(packages))
self.execute(*packages)
+ elif system.startswith('CYGWIN'):
+ self.log.info('Looks like you are using Cygwin')
+ self.log.info('Please install the dependencies manually.')
#########################################################################
# Determine the system's basic configuration #
@@ -682,7 +685,10 @@ class PrepareBuild(CommandLineApp):
if self.options.python:
self.configure_args.append('-DUSE_PYTHON=1')
- if self.options.use_ninja:
+ if system.startswith('CYGWIN'):
+ self.configure_args.append('-G')
+ self.configure_args.append('Unix Makefiles')
+ elif self.options.use_ninja:
self.configure_args.append('-GNinja')
if exists('/Users/johnw/Projects/ledger/plan/TODO'):
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index aec75c06..dcafeba2 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -167,7 +167,12 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
if (BUILD_LIBRARY)
list(APPEND _args ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
endif()
- list(APPEND _args "-std=c++11 ")
+ if (CYGWIN)
+ list(APPEND _args "-std=c++11 ")
+ list(APPEND _args "-U__STRICT_ANSI__")
+ else()
+ list(APPEND _args "-std=c++11 ")
+ endif()
list(APPEND _args "-x c++-header " ${_inc})
list(APPEND _args -c ${_header_filename} -o ${_pch_filename})
@@ -223,7 +228,12 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
list(APPEND _args ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
endif()
list(APPEND _args ${GXX_WARNING_FLAGS})
- list(APPEND _args "-std=c++11 ")
+ if (CYGWIN)
+ list(APPEND _args "-std=c++11 ")
+ list(APPEND _args "-U__STRICT_ANSI__")
+ else()
+ list(APPEND _args "-std=c++11 ")
+ endif()
list(APPEND _args "-x c++-header " ${_inc})
list(APPEND _args -c ${_header_filename} -o ${_gch_filename})