Skip to content

Commit 8d3712f

Browse files
committed
Fix conditions on local projects. Add unicode test scripts.
1 parent 41ca7c5 commit 8d3712f

6 files changed

Lines changed: 23 additions & 0 deletions

File tree

src/printers/cmake.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,8 @@ void CMakePrinter::print_copy_dependencies(CMakeContext &ctx, const String &targ
852852
{
853853
auto &p = dp.second;
854854

855+
p.conditions.insert(rd[p].config->getDefaultProject().condition);
856+
855857
if (p.flags[pfExecutable])
856858
{
857859
// if we have an exe, we must include all dependent targets
@@ -1214,6 +1216,9 @@ endif()
12141216
{
12151217
if (!once)
12161218
{
1219+
dep.second.conditions.insert(rd[dep.second].config->getDefaultProject().condition);
1220+
ScopedDependencyCondition sdc(ctx, dep.second);
1221+
12171222
// this or selected project below
12181223
ctx.addLine("set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT " + dep.second.target_name_hash + ")");
12191224
once = true;
@@ -2926,6 +2931,7 @@ add_dependencies()" + old_cppan_target + R"( run-cppan)
29262931
{
29272932
if (!dep.second.flags[pfLocalProject])
29282933
continue;
2934+
dep.second.conditions.insert(rd[dep.second].config->getDefaultProject().condition);
29292935
if (dep.second.flags[pfExecutable])
29302936
{
29312937
ScopedDependencyCondition sdc(ctx, dep.second);

test/run/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ cppan_add_test_simple(zlib_no_cache)
7070
cppan_add_test_suite(zlib_no_cache_short_local_names)
7171
cppan_add_test_suite(dep_in_dep_png_nanobp)
7272
cppan_add_test_suite(dep_in_dep_png_nanobp_no_cache)
73+
cppan_add_test_suite(project_condition)
7374

7475
# ninja
7576
find_program(n ninja)

test/run/project_condition.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
local_settings:
2+
storage_dir: storage
3+
4+
projects:
5+
examples.cpp.helloworld.server:
6+
files: dummy.cpp
7+
condition: 0
8+
9+

tools/test.bat

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
cd /d d:\dev\cppan_client\win32_test_spaces_and_unicode
2+
cppan -d ..
3+
cmake ..
4+
cmake --build .
5+
pause

tools/test_unicode.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
runas /savecred /user:Èìÿ "d:\dev\cppan_client\win32_test_spaces_and_unicode\test.bat"

tools/test_unicode_with_spaces.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
runas /savecred /user:"Èìÿ Ôàìèëèÿ" "d:\dev\cppan_client\win32_test_spaces_and_unicode\test.bat"

0 commit comments

Comments
 (0)