From 6c0a83153ccff00f4b282288aec5f6fb68d8307b Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 17 Jul 2017 23:15:16 +0100 Subject: [PATCH 1/2] Attempt at fixing blatant Linux/POSIX issues. --- Tier0/premake5.lua | 11 ++++++++++- Tier1/premake5.lua | 16 ++++++++++------ premake5.lua | 11 +++++++---- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/Tier0/premake5.lua b/Tier0/premake5.lua index c8473c19c8c..68ed458525e 100644 --- a/Tier0/premake5.lua +++ b/Tier0/premake5.lua @@ -3,4 +3,13 @@ include ".." includedirs "../src/common" includedirs "../src/public" includedirs "../src/public/tier0" -links "tier0" + +filter "system:not linux" + links "tier0" +filter "system:linux" + prelinkcommands { + "mkdir -p " .. solution().location .. "/bin", + "ln -f " .. _SCRIPT_DIR .. "/../src/lib/public/linux32/libtier0.so " .. solution().location .. "/bin/libtier0.so" + } + linkoptions { "-Wl,--no-as-needed", "bin/libtier0.so" } +filter {} diff --git a/Tier1/premake5.lua b/Tier1/premake5.lua index 0e2e200c404..1a494156082 100644 --- a/Tier1/premake5.lua +++ b/Tier1/premake5.lua @@ -6,8 +6,6 @@ includedirs "../src/public/tier1" vpaths { Tier1 = "../src/tier1/*.cpp" } -links "vstdlib" - files { "../src/tier1/bitbuf.cpp", "../src/tier1/byteswap.cpp", @@ -48,13 +46,19 @@ files { "../src/tier1/utlsymbol.cpp" } -if os.is "windows" then - links { "Ws2_32", "Rpcrt4" } +filter "system:windows" + links { "vstdlib", "Ws2_32", "Rpcrt4" } files "../src/tier1/processor_detect.cpp" -else +filter "system:linux" + buildoptions "-std=gnu++11" + prelinkcommands("ln -f " .. _SCRIPT_DIR .. "/../src/lib/public/linux32/libvstdlib.so " .. solution().location .. "/bin/libvstdlib.so") + linkoptions "bin/libvstdlib.so" +filter "system:macosx" + links "vstdlib" +filter "system:not windows" files { "../src/tier1/processor_detect_linux.cpp", "../src/tier1/qsort_s.cpp", "../src/tier1/pathmatch.cpp" } -end +filter {} diff --git a/premake5.lua b/premake5.lua index 70d3174af3f..1cf7fe9770a 100644 --- a/premake5.lua +++ b/premake5.lua @@ -5,10 +5,13 @@ local libLocations = { } local osDefinition = { - windows = { "WIN32" }, - macosx = { "POSIX", "_POSIX", "GNUC", "OSX" }, - linux = { "POSIX", "_POSIX", "LINUX", "_LINUX", "GNUC" } + windows = { "WIN32", "_DLL_EXT=dll" }, + macosx = { "POSIX", "_POSIX", "GNUC", "OSX", "_DLL_EXT=dylib", "NO_MALLOC_OVERRIDE" }, + linux = { "POSIX", "_POSIX", "LINUX", "_LINUX", "GNUC", "_DLL_EXT=so", "NO_MALLOC_OVERRIDE" } } -libdirs(libLocations[os.get()]) defines(osDefinition[os.get()]) + +filter "system:not linux" + libdirs(libLocations[os.get()]) +filter {} From 8076f9dbf8ced9d051c7aca749966c2eb3201844 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 18 Jul 2017 12:20:56 +0100 Subject: [PATCH 2/2] This is fine. I'm fine with the events currently unfolding. --- Tier0/premake5.lua | 11 +---------- Tier1/premake5.lua | 11 ++++------- premake5.lua | 5 +---- 3 files changed, 6 insertions(+), 21 deletions(-) diff --git a/Tier0/premake5.lua b/Tier0/premake5.lua index 68ed458525e..c8473c19c8c 100644 --- a/Tier0/premake5.lua +++ b/Tier0/premake5.lua @@ -3,13 +3,4 @@ include ".." includedirs "../src/common" includedirs "../src/public" includedirs "../src/public/tier0" - -filter "system:not linux" - links "tier0" -filter "system:linux" - prelinkcommands { - "mkdir -p " .. solution().location .. "/bin", - "ln -f " .. _SCRIPT_DIR .. "/../src/lib/public/linux32/libtier0.so " .. solution().location .. "/bin/libtier0.so" - } - linkoptions { "-Wl,--no-as-needed", "bin/libtier0.so" } -filter {} +links "tier0" diff --git a/Tier1/premake5.lua b/Tier1/premake5.lua index 1a494156082..a4b4018dfc5 100644 --- a/Tier1/premake5.lua +++ b/Tier1/premake5.lua @@ -6,6 +6,8 @@ includedirs "../src/public/tier1" vpaths { Tier1 = "../src/tier1/*.cpp" } +links "vstdlib" + files { "../src/tier1/bitbuf.cpp", "../src/tier1/byteswap.cpp", @@ -47,18 +49,13 @@ files { } filter "system:windows" - links { "vstdlib", "Ws2_32", "Rpcrt4" } + links { "Ws2_32", "Rpcrt4" } files "../src/tier1/processor_detect.cpp" filter "system:linux" buildoptions "-std=gnu++11" - prelinkcommands("ln -f " .. _SCRIPT_DIR .. "/../src/lib/public/linux32/libvstdlib.so " .. solution().location .. "/bin/libvstdlib.so") - linkoptions "bin/libvstdlib.so" -filter "system:macosx" - links "vstdlib" filter "system:not windows" files { "../src/tier1/processor_detect_linux.cpp", - "../src/tier1/qsort_s.cpp", - "../src/tier1/pathmatch.cpp" + "../src/tier1/qsort_s.cpp" } filter {} diff --git a/premake5.lua b/premake5.lua index 1cf7fe9770a..01f12a28789 100644 --- a/premake5.lua +++ b/premake5.lua @@ -10,8 +10,5 @@ local osDefinition = { linux = { "POSIX", "_POSIX", "LINUX", "_LINUX", "GNUC", "_DLL_EXT=so", "NO_MALLOC_OVERRIDE" } } +libdirs(libLocations[os.get()]) defines(osDefinition[os.get()]) - -filter "system:not linux" - libdirs(libLocations[os.get()]) -filter {}