Win32 fixes.
[SVN r18182]
This commit is contained in:
parent
3ed8693101
commit
394043114a
@ -28,7 +28,7 @@ exe a : a_empty.cpp : <variant>release ;
|
||||
exe a : a.cpp : <variant>debug ;
|
||||
""")
|
||||
|
||||
t.run_build_system(pass_toolset=0)
|
||||
t.run_build_system()
|
||||
t.expect_addition("bin/$toolset/debug/a.exe")
|
||||
|
||||
|
||||
|
@ -48,8 +48,11 @@ t.write("a/Jamfile", """
|
||||
exe a : a.cpp ../b/b ;
|
||||
""")
|
||||
t.write("a/a.cpp", """
|
||||
#ifdef _WIN32
|
||||
__declspec(dllimport)
|
||||
#endif
|
||||
void foo();
|
||||
int main() { foo(); }
|
||||
int main() { foo(); return 0; }
|
||||
""")
|
||||
|
||||
t.write("b/Jamfile", """
|
||||
@ -57,6 +60,9 @@ t.write("b/Jamfile", """
|
||||
""")
|
||||
t.write("b/b.cpp", """
|
||||
#ifdef FOO
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
void foo() {}
|
||||
#endif
|
||||
""")
|
||||
|
@ -25,6 +25,9 @@ t.write("Jamfile", """
|
||||
exe hello : hello.cpp d/l ;
|
||||
""")
|
||||
t.write("hello.cpp", """
|
||||
#ifdef _WIN32
|
||||
__declspec(dllimport)
|
||||
#endif
|
||||
void foo();
|
||||
int main()
|
||||
{
|
||||
@ -38,6 +41,9 @@ t.write("d/Jamfile", """
|
||||
lib l : l.cpp : <foo>on:<define>FOO ;
|
||||
""")
|
||||
t.write("l.cpp", """
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
#ifdef FOO
|
||||
void foo() {}
|
||||
#endif
|
||||
|
@ -5,7 +5,7 @@
|
||||
from BoostBuild import Tester
|
||||
from string import find
|
||||
|
||||
t = Tester(pass_toolset=0)
|
||||
t = Tester(pass_toolset=1)
|
||||
|
||||
t.write("project-root.jam", "")
|
||||
t.write("Jamfile", """
|
||||
@ -39,24 +39,11 @@ exe a : dir/hello1.cpp ;
|
||||
exe b : dir/hello1.cpp/<hardcode-dll-paths>true ;
|
||||
""")
|
||||
|
||||
t.write("project-root.jam", """
|
||||
import gcc ;
|
||||
|
||||
rule copy-file ( targets * : sources * : * )
|
||||
{
|
||||
copy-file-action $(targets) : $(sources) ;
|
||||
}
|
||||
|
||||
actions copy-file-action
|
||||
{
|
||||
cp $(>) $(<)
|
||||
}
|
||||
|
||||
IMPORT $(__name__) : copy-file : : copy-file ;
|
||||
""")
|
||||
t.write("project-root.jam", "")
|
||||
|
||||
t.write("dir/Jamfile", """
|
||||
make hello1.cpp : hello.cpp : copy-file ;
|
||||
import common ;
|
||||
make hello1.cpp : hello.cpp : common.copy ;
|
||||
|
||||
""")
|
||||
|
||||
@ -67,6 +54,6 @@ int main()
|
||||
}
|
||||
""")
|
||||
t.run_build_system("-d2")
|
||||
t.fail_test(t.stdout().count("copy-file") != 1)
|
||||
t.fail_test(t.stdout().count("common.copy") != 1)
|
||||
|
||||
t.cleanup()
|
||||
|
@ -13,6 +13,7 @@ t.run_build_system("debug release", subdir="ext")
|
||||
# Then pretend that we don't have the sources for the external project,
|
||||
# and can only use compiled binaries
|
||||
t.copy("ext/Jamfile2", "ext/Jamfile")
|
||||
t.expand_toolset("ext/Jamfile")
|
||||
|
||||
# Now check that we can build the main project, and that
|
||||
# correct prebuilt file is picked, depending of variant.
|
||||
|
@ -4,19 +4,19 @@ import modules ;
|
||||
local dll-suffix = so ;
|
||||
if [ modules.peek : OS ] in NT CYGWIN
|
||||
{
|
||||
dll-suffix = dll ;
|
||||
dll-suffix = lib ;
|
||||
}
|
||||
|
||||
project ext ;
|
||||
|
||||
lib a :
|
||||
: <file>bin/gcc/debug/a.$(dll-suffix) <variant>debug
|
||||
: <file>bin/$toolset/debug/a.$(dll-suffix) <variant>debug
|
||||
:
|
||||
: <include>debug
|
||||
;
|
||||
|
||||
lib a :
|
||||
: <file>bin/gcc/release/a.$(dll-suffix) <variant>release
|
||||
: <file>bin/$toolset/release/a.$(dll-suffix) <variant>release
|
||||
:
|
||||
: <include>release
|
||||
;
|
||||
|
@ -8,6 +8,9 @@
|
||||
// http://www.boost.org
|
||||
//
|
||||
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
#ifdef RELEASE
|
||||
void release() {}
|
||||
#else
|
||||
|
@ -8,4 +8,7 @@
|
||||
// http://www.boost.org
|
||||
//
|
||||
|
||||
#ifdef _WIN32
|
||||
__declspec(dllimport)
|
||||
#endif
|
||||
void debug();
|
||||
|
@ -8,4 +8,7 @@
|
||||
// http://www.boost.org
|
||||
//
|
||||
|
||||
#ifdef _WIN32
|
||||
__declspec(dllimport)
|
||||
#endif
|
||||
void release();
|
||||
|
@ -17,4 +17,5 @@ int main()
|
||||
#else
|
||||
debug();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
@ -12,7 +12,12 @@ t = Tester()
|
||||
t.write("project-root.jam", "import gcc ;")
|
||||
t.write("Jamfile", "build-project src ;")
|
||||
t.write("lib/Jamfile", "lib lib1 : lib1.cpp ;")
|
||||
t.write("lib/lib1.cpp", "void foo() {}\n")
|
||||
t.write("lib/lib1.cpp", """
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
void foo() {}\n
|
||||
""")
|
||||
t.write("src/Jamfile", """
|
||||
project
|
||||
: requirements <library>../lib/lib1
|
||||
@ -22,6 +27,9 @@ exe a : a.cpp ;
|
||||
exe b : b.cpp ;
|
||||
""")
|
||||
t.write("src/a.cpp", """
|
||||
#ifdef _WIN32
|
||||
__declspec(dllimport)
|
||||
#endif
|
||||
void foo();
|
||||
int main() { foo(); return 0; }
|
||||
""")
|
||||
|
@ -5,17 +5,30 @@
|
||||
|
||||
from BoostBuild import Tester
|
||||
import string
|
||||
import os
|
||||
t = Tester()
|
||||
|
||||
# To start with, we have to prepate a library to link with
|
||||
t.write("lib/project-root.jam", "import gcc ; ")
|
||||
t.write("lib/project-root.jam", "")
|
||||
t.write("lib/Jamfile", "lib test_lib : test_lib.cpp ;")
|
||||
t.write("lib/test_lib.cpp", "void foo() {}\n");
|
||||
t.write("lib/test_lib.cpp", """
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
void foo() {}
|
||||
""");
|
||||
|
||||
t.run_build_system(subdir="lib")
|
||||
t.expect_addition("lib/bin/$toolset/debug/test_lib.dll")
|
||||
|
||||
t.copy("lib/bin/$toolset/debug/test_lib.dll", "lib/libtest_lib.dll")
|
||||
# Auto adjusting of suffixes does not work, since we need to
|
||||
# change dll to lib.
|
||||
#
|
||||
if os.name == 'nt':
|
||||
t.copy("lib/bin/$toolset/debug/test_lib.lib", "lib/test_lib.lib")
|
||||
else:
|
||||
t.copy("lib/bin/$toolset/debug/test_lib.dll", "lib/libtest_lib.dll")
|
||||
|
||||
|
||||
|
||||
# A regression test: <library>property referring to
|
||||
@ -39,6 +52,9 @@ lib test_lib : : <name>test_lib <search>../../lib ;
|
||||
lib a : a.cpp : : : <library>test_lib ;
|
||||
""")
|
||||
t.write('d/d2/a.cpp', """
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport) int force_library_creation_for_a;
|
||||
#endif
|
||||
""")
|
||||
|
||||
t.run_build_system()
|
||||
|
@ -85,11 +85,11 @@ tests = [ "project_test1",
|
||||
"alternatives",
|
||||
"unused",
|
||||
"default_features",
|
||||
"railsys",
|
||||
"print",
|
||||
]
|
||||
|
||||
if os.name == 'posix':
|
||||
tests.append("symlink")
|
||||
tests.append("railsys") # Actually, needs QT
|
||||
|
||||
run_tests(critical_tests, tests)
|
||||
|
Loading…
Reference in New Issue
Block a user