From 8ac9ddf460cc4c1b2972df1069128fb615b31042 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 2 Jan 2018 19:30:52 +0100 Subject: Fix bug when using config for several platforms in one project --- tests/src/confTest/confTest.cpp | 19 ++++++++++ .../src/confTest/linux/x64/static/debug/libcool.a | 0 .../confTest/linux/x64/static/release/libcool.a | 0 tests/src/confTest/platformConfig.conf | 41 ++++++++++++++++++++++ 4 files changed, 60 insertions(+) create mode 100644 tests/src/confTest/linux/x64/static/debug/libcool.a create mode 100644 tests/src/confTest/linux/x64/static/release/libcool.a create mode 100644 tests/src/confTest/platformConfig.conf (limited to 'tests') diff --git a/tests/src/confTest/confTest.cpp b/tests/src/confTest/confTest.cpp index a32f2ae..94cdb11 100644 --- a/tests/src/confTest/confTest.cpp +++ b/tests/src/confTest/confTest.cpp @@ -55,3 +55,22 @@ TEST_CASE("parse config - invalid field") REQUIRE(result.isErr()); REQUIRE(result.getErrMsg() == "Invalid field \"invalidField\" under object \"package\""); } + +TEST_CASE("parse config - use different config for different platforms") +{ + SibsConfig sibsConfig(Compiler::GCC, TINYDIR_STRING("tests/src/confTest")); + Result result = Config::readFromFile(TINYDIR_STRING("tests/src/confTest/platformConfig.conf"), sibsConfig); + if(result.isErr()) + { + fprintf(stderr, "%s", result.getErrMsg().c_str()); + exit(1); + } + + #if OS_TYPE == OS_TYPE_LINUX and defined(SIBS_ENV_64BIT) + #ifdef DEBUG + REQUIRE(sibsConfig.getDebugStaticLibs()[0] == TINYDIR_STRING("tests/src/confTest/linux/x64/static/debug/libcool.a")); + #else + REQUIRE(sibsConfig.getDebugStaticLibs()[0] == TINYDIR_STRING("tests/src/confTest/linux/x64/static/release/libcool.a")); + #endif + #endif +} diff --git a/tests/src/confTest/linux/x64/static/debug/libcool.a b/tests/src/confTest/linux/x64/static/debug/libcool.a new file mode 100644 index 0000000..e69de29 diff --git a/tests/src/confTest/linux/x64/static/release/libcool.a b/tests/src/confTest/linux/x64/static/release/libcool.a new file mode 100644 index 0000000..e69de29 diff --git a/tests/src/confTest/platformConfig.conf b/tests/src/confTest/platformConfig.conf new file mode 100644 index 0000000..e74ab76 --- /dev/null +++ b/tests/src/confTest/platformConfig.conf @@ -0,0 +1,41 @@ +[package] +name = "glew" +version = "2.1.0" +type = "library" +platforms = ["any"] + +[config.linux32] +expose_include_dirs = ["include_linux32"] + +[config.linux32.static.debug] +lib = "linux/x86/static/debug" + +[config.linux32.static.release] +lib = "linux/x86/static/release" + +[config.linux64] +expose_include_dirs = ["include_linux64"] + +[config.linux64.static.debug] +lib = "linux/x64/static/debug" + +[config.linux64.static.release] +lib = "linux/x64/static/release" + +[config.win32] +expose_include_dirs = ["include_win32"] + +[config.win32.static.debug] +lib = "windows/x86/static/debug" + +[config.win32.static.release] +lib = "windows/x86/static/release" + +[config.win64] +expose_include_dirs = ["include_win64"] + +[config.win64.static.debug] +lib = "windows/x64/static/debug" + +[config.win64.static.release] +lib = "windows/x64/static/release" -- cgit v1.2.3