Skip to content
This repository has been archived by the owner on Dec 25, 2017. It is now read-only.

Commit

Permalink
add premake5.lua for [premake5](https://github.com/premake/premake-core)
Browse files Browse the repository at this point in the history
clean up the compat files.
add precompiled header for vs.
modify version value from configure.ac, [ag.vim](https://github.com/rking/ag.vim) use it.
  • Loading branch information
leeonix committed Jul 4, 2015
1 parent 47dfd76 commit 4864804
Show file tree
Hide file tree
Showing 359 changed files with 307 additions and 65,066 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ rel/
*.sdf
*suo
obj/
build/
101 changes: 101 additions & 0 deletions premake5.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
-- to generate Visual Studio files in vs-premake directory, run:
-- premake4 vs2010 or premake4 vs2008

solution 'ag'
configurations { 'Debug', 'Release', 'ReleaseKjk' }
location 'build' -- this is where generated solution/project files go
flags { 'StaticRuntime', 'NoRTTI', 'Unicode', 'NoExceptions', }
defines {
-- windows
'WIN32', '_WIN32', 'WINDOWS', '_WINDOWS',
-- pthread
'PTW32_BUILD_INLINED', 'PTW32_STATIC_LIB', '__CLEANUP_C',
-- pcre
'HAVE_CONFIG_H', 'PCRE_STATIC',
-- zlib
'Z_SOLO',
}

filter 'action:vs*'
flags { 'NoMinimalRebuild', 'MultiProcessorCompile', }
disablewarnings {
'4996', -- 4996 - same as define _CRT_SECURE_NO_WARNINGS
'4800', -- 4800 - int -> bool coversion
'4127', -- 4127 - conditional expression is constant
'4100', -- 4100 - unreferenced formal parameter
'4244', -- 4244 - possible loss of data due to conversion
}
forceincludes 'pch.h'
pchheader 'pch.h'
pchsource 'wincompat/pch.c'

filter 'configurations:Debug'
flags { 'Symbols' }
targetdir 'dbg'
defines { '_DEBUG', 'DEBUG' }
optimize 'Debug'

filter 'configurations:Release*'
targetdir 'rel'
defines { 'NDEBUG' }
optimize 'Full'

project 'ag'
uuid '066DD594-55FF-4E6C-9DB7-A68131864C7B'
kind 'ConsoleApp'
language 'C++'

includedirs {
'src',
'wincompat',
'wincompat/pcre',
'wincompat/pthread',
'wincompat/zlib',
}
links {
'shlwapi',
'dependlib',
}
files {
'src/**.h',
'src/**.c',
'wincompat/*.h',
'wincompat/*.c',
}

filter 'configurations:ReleaseKjk'
defines { 'KJK_BUILD' }
files 'wincompat/kjk_crash_handler.cpp'

filter 'action:not vs*'
removefiles 'wincompat/pch.h'
removefiles 'wincompat/pch.c'

filter 'action:vs*'
buildoptions '/TP' -- /TP - compile as c++

project 'dependlib'
uuid 'D5FE0DC7-F69E-408B-809A-B01B414F9DDF'
kind 'StaticLib'
language 'C'

includedirs {
'wincompat/pcre',
'wincompat/pthread',
'wincompat/zlib',
}
files {
'wincompat/zlib/*.h',
'wincompat/zlib/*.c',
'wincompat/pcre/*.h',
'wincompat/pcre/*.c',
'wincompat/pthread/*.h',
'wincompat/pthread/pthread.c',
}

filter 'action:vs*'
files {
'wincompat/pch.h',
'wincompat/pch.c',
}

3 changes: 2 additions & 1 deletion src/print.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,10 @@ const char *normalize_path(const char *path) {
}

const char* fix_path_slashes(const char* path) {
char *i;
char* buf = strdup(path);
#ifdef _WIN32
for(char* i = buf; *i; ++i)
for(i = buf; *i; ++i)
{
if(*i == '/') *i = '\\';
}
Expand Down
2 changes: 1 addition & 1 deletion wincompat/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

#include "unixcompat.h"

#define PACKAGE_VERSION "0.18.1"
#define PACKAGE_VERSION "0.29.1"

#endif
1 change: 1 addition & 0 deletions wincompat/pch.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "pch.h"
9 changes: 9 additions & 0 deletions wincompat/pch.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <time.h>
#include <ctype.h>
#include <limits.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <windows.h>
Loading

0 comments on commit 4864804

Please sign in to comment.