Premake: Fix libcryptopp build and use files shipped with bitmrc.
This commit is contained in:
parent
fb737eb9d2
commit
1c9badb4a2
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -32,6 +32,3 @@
|
||||
[submodule "deps/bitmrc"]
|
||||
path = deps/bitmrc
|
||||
url = https://github.com/mrc-g/BitMRC.git
|
||||
[submodule "deps/libcryptopp"]
|
||||
path = deps/libcryptopp
|
||||
url = https://github.com/weidai11/cryptopp.git
|
||||
|
1
deps/libcryptopp
vendored
1
deps/libcryptopp
vendored
@ -1 +0,0 @@
|
||||
Subproject commit 65e91a8caa8c1846cb311bc83d8507e12699d6d3
|
@ -17,33 +17,121 @@ end
|
||||
function libcryptopp.includes()
|
||||
if not libcryptopp.settings then error("Run libcryptopp.setup first") end
|
||||
|
||||
includedirs { libcryptopp.settings.source }
|
||||
filter "Debug*"
|
||||
defines { "_DEBUG" }
|
||||
|
||||
filter "Release*"
|
||||
defines { "NDEBUG" }
|
||||
|
||||
filter "system:windows"
|
||||
defines { "_WINDOWS", "WIN32" }
|
||||
filter {}
|
||||
|
||||
includedirs { libcryptopp.settings.source }
|
||||
end
|
||||
|
||||
function libcryptopp.project()
|
||||
if not libcryptopp.settings then error("Run libcryptopp.setup first") end
|
||||
|
||||
externalrule "MASM"
|
||||
buildmessage "Building and assembling %(Identity)..."
|
||||
propertydefinition {
|
||||
name = "PreprocessorDefinitions",
|
||||
kind = "string",
|
||||
value = "",
|
||||
switch = "/D",
|
||||
}
|
||||
propertydefinition {
|
||||
name = "UseSafeExceptionHandlers",
|
||||
kind = "boolean",
|
||||
value = false,
|
||||
switch = "/safeseh",
|
||||
}
|
||||
|
||||
--[[
|
||||
rule "CustomProtoBuildTool"
|
||||
display "C++ prototype copy"
|
||||
location "./build"
|
||||
fileExtension ".proto"
|
||||
buildmessage "Preparing %(Identity)..."
|
||||
buildcommands {
|
||||
'if not exist "$(ProjectDir)\\src\\%(Filename)" copy "%(Identity)" "$(ProjectDir)\\src\\%(Filename)"',
|
||||
'echo: >> "src\\%(Filename).copied"',
|
||||
}
|
||||
buildoutputs {
|
||||
'$(ProjectDir)\\src\\%(Filename)',
|
||||
}
|
||||
]]
|
||||
|
||||
project "libcryptopp"
|
||||
language "C++"
|
||||
characterset "MBCS"
|
||||
|
||||
defines {
|
||||
"USE_PRECOMPILED_HEADERS"
|
||||
}
|
||||
includedirs
|
||||
{
|
||||
libcryptopp.settings.source
|
||||
libcryptopp.settings.source,
|
||||
}
|
||||
files
|
||||
{
|
||||
path.join(libcryptopp.settings.source, "src/**.cpp"),
|
||||
}
|
||||
removefiles
|
||||
{
|
||||
path.join(libcryptopp.settings.source, "TestData/**"),
|
||||
path.join(libcryptopp.settings.source, "TestVectors/**"),
|
||||
path.join(libcryptopp.settings.source, "*.cpp"),
|
||||
--path.join(libcryptopp.settings.source, "*.cpp.proto"),
|
||||
path.join(libcryptopp.settings.source, "*.h"),
|
||||
path.join(libcryptopp.settings.source, "*.txt"),
|
||||
}
|
||||
|
||||
-- not our code, ignore POSIX usage warnings for now
|
||||
removefiles {
|
||||
path.join(libcryptopp.settings.source, "eccrypto.cpp"),
|
||||
path.join(libcryptopp.settings.source, "eprecomp.cpp"),
|
||||
path.join(libcryptopp.settings.source, "bench*"),
|
||||
path.join(libcryptopp.settings.source, "*test.*"),
|
||||
path.join(libcryptopp.settings.source, "fipsalgt.*"),
|
||||
path.join(libcryptopp.settings.source, "cryptlib_bds.*"),
|
||||
path.join(libcryptopp.settings.source, "validat*.*"),
|
||||
}
|
||||
|
||||
-- Pre-compiled header
|
||||
pchheader "pch.h" -- must be exactly same as used in #include directives
|
||||
pchsource(path.join(libcryptopp.settings.source, "pch.cpp")) -- real path
|
||||
|
||||
defines { "_SCL_SECURE_NO_WARNINGS" }
|
||||
warnings "Off"
|
||||
|
||||
-- always build as static lib, as we include our custom classes and therefore can't perform shared linking
|
||||
kind "StaticLib"
|
||||
vectorextensions "SSE"
|
||||
|
||||
rules {
|
||||
"MASM",
|
||||
--"CustomProtoBuildTool",
|
||||
}
|
||||
|
||||
kind "SharedLib"
|
||||
filter "*Static"
|
||||
kind "StaticLib"
|
||||
|
||||
filter "kind:SharedLib"
|
||||
defines { "CRYPTOPP_IMPORTS" }
|
||||
|
||||
filter "architecture:x86"
|
||||
exceptionhandling "SEH"
|
||||
masmVars {
|
||||
UseSafeExceptionHandlers = true,
|
||||
PreprocessorDefinitions = "_M_X86",
|
||||
}
|
||||
filter "architecture:x64"
|
||||
files {
|
||||
path.join(libcryptopp.settings.source, "x64masm.asm"),
|
||||
}
|
||||
masmVars {
|
||||
PreprocessorDefinitions = "_M_X64",
|
||||
}
|
||||
filter { "architecture:x64", "kind:SharedLib" }
|
||||
files {
|
||||
path.join(libcryptopp.settings.source, "x64dll.asm"),
|
||||
}
|
||||
|
||||
filter("files:" .. path.join(libcryptopp.settings.source, "dll.cpp")
|
||||
.. " or files:" .. path.join(libcryptopp.settings.source, "iterhash.cpp"))
|
||||
flags { "NoPCH" }
|
||||
end
|
||||
|
16
premake5.lua
16
premake5.lua
@ -137,6 +137,10 @@ require "premake/zlib"
|
||||
require "premake/libcryptopp"
|
||||
require "premake/bitmrc"
|
||||
|
||||
bitmrc.setup
|
||||
{
|
||||
source = path.join(depsBasePath, "bitmrc"),
|
||||
}
|
||||
fmt.setup
|
||||
{
|
||||
source = path.join(depsBasePath, "fmt"),
|
||||
@ -145,6 +149,10 @@ json11.setup
|
||||
{
|
||||
source = path.join(depsBasePath, "json11"),
|
||||
}
|
||||
libcryptopp.setup
|
||||
{
|
||||
source = path.join(depsBasePath, "bitmrc/libcryptopp"),
|
||||
}
|
||||
libtomcrypt.setup
|
||||
{
|
||||
defines = {
|
||||
@ -184,14 +192,6 @@ zlib.setup
|
||||
},
|
||||
source = path.join(depsBasePath, "zlib"),
|
||||
}
|
||||
libcryptopp.setup
|
||||
{
|
||||
source = path.join(depsBasePath, "libcryptopp"),
|
||||
}
|
||||
bitmrc.setup
|
||||
{
|
||||
source = path.join(depsBasePath, "bitmrc"),
|
||||
}
|
||||
|
||||
workspace "iw4x"
|
||||
location "./build"
|
||||
|
Loading…
Reference in New Issue
Block a user