summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/manual/cmake-server.7.rst129
-rw-r--r--Modules/Platform/Android-Common.cmake4
-rw-r--r--Modules/Platform/Android/abi-arm64-v8a-Clang.cmake5
-rw-r--r--Modules/Platform/Android/abi-arm64-v8a-GNU.cmake6
-rw-r--r--Modules/Platform/Android/abi-armeabi-Clang.cmake1
-rw-r--r--Modules/Platform/Android/abi-armeabi-GNU.cmake1
-rw-r--r--Modules/Platform/Android/abi-armeabi-v6-Clang.cmake1
-rw-r--r--Modules/Platform/Android/abi-armeabi-v6-GNU.cmake1
-rw-r--r--Modules/Platform/Android/abi-armeabi-v7a-Clang.cmake1
-rw-r--r--Modules/Platform/Android/abi-armeabi-v7a-GNU.cmake1
-rw-r--r--Modules/Platform/Android/abi-common.cmake15
-rw-r--r--Modules/Platform/Android/abi-mips-Clang.cmake4
-rw-r--r--Modules/Platform/Android/abi-mips-GNU.cmake3
-rw-r--r--Modules/Platform/Android/abi-mips64-Clang.cmake4
-rw-r--r--Modules/Platform/Android/abi-mips64-GNU.cmake3
-rw-r--r--Modules/Platform/Android/abi-x86-Clang.cmake4
-rw-r--r--Modules/Platform/Android/abi-x86_64-Clang.cmake4
-rw-r--r--Modules/Platform/Android/ndk-stl-c++_static.cmake2
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx44
-rw-r--r--Source/cmGlobalNinjaGenerator.h1
-rw-r--r--Tests/RunCMake/Android/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/Ninja/RunCMakeTest.cmake9
-rw-r--r--Tests/RunCMake/Ninja/SubDir.cmake1
-rw-r--r--Tests/RunCMake/Ninja/SubDirBinary-build-stdout.txt1
-rw-r--r--Tests/RunCMake/Ninja/SubDirBinary-install-stdout.txt1
-rw-r--r--Tests/RunCMake/Ninja/SubDirBinary-test-stdout.txt1
-rw-r--r--Tests/RunCMake/Ninja/SubDirSource/CMakeLists.txt6
27 files changed, 109 insertions, 149 deletions
diff --git a/Help/manual/cmake-server.7.rst b/Help/manual/cmake-server.7.rst
index afd4e2b..5eec009 100644
--- a/Help/manual/cmake-server.7.rst
+++ b/Help/manual/cmake-server.7.rst
@@ -250,7 +250,9 @@ This is the only message ever sent by the server that is not of type "reply",
It will contain "supportedProtocolVersions" with an array of server protocol
versions supported by the cmake server. These are JSON objects with "major" and
-"minor" keys containing non-negative integer values.
+"minor" keys containing non-negative integer values. Some versions may be marked
+as experimental. These will contain the "isExperimental" key set to true. Enabling
+these requires a special command line argument when starting the cmake server mode.
Example::
@@ -403,7 +405,7 @@ CMake will reply like this (after reporting progress for some time)::
Type "compute"
^^^^^^^^^^^^^^
-This requist will generate build system files in the build directory and
+This request will generate build system files in the build directory and
is only available after a project was successfully "configure"d.
Example::
@@ -426,8 +428,19 @@ The "codemodel" request can be used after a project was "compute"d successfully.
It will list the complete project structure as it is known to cmake.
-The reply will contain a key "projects", which will contain a list of
-project objects, one for each (sub-)project defined in the cmake build system.
+The reply will contain a key "configurations", which will contain a list of
+configuration objects. Configuration objects are used to destinquish between
+different configurations the build directory might have enabled. While most
+generators only support one configuration, others might support several.
+
+Each configuration object can have the following keys:
+
+"name"
+ contains the name of the configuration. The name may be empty.
+"projects"
+ contains a list of project objects, one for each build project.
+
+Project objects define one (sub-)project defined in the cmake build system.
Each project object can have the following keys:
@@ -437,19 +450,8 @@ Each project object can have the following keys:
contains the current source directory
"buildDirectory"
contains the current build directory.
-"configurations"
- contains a list of configuration objects.
-
-Configuration objects are used to destinquish between different
-configurations the build directory might have enabled. While most generators
-only support one configuration, others support several.
-
-Each configuration object can have the following keys:
-
-"name"
- contains the name of the configuration. The name may be empty.
"targets"
- contains a list of target objects, one for each build target.
+ contains a list of build system target objects.
Target objects define individual build targets for a certain configuration.
@@ -520,88 +522,53 @@ sourceDirectory of the target.
Example::
[== CMake Server ==[
- {"type":"project"}
+ {"type":"codemodel"}
]== CMake Server ==]
CMake will reply::
[== CMake Server ==[
{
- "cookie":"",
- "type":"reply",
- "inReplyTo":"project",
-
- "projects":
- [
+ "configurations": [
{
- "name":"CMAKE_FORM",
- "sourceDirectory":"/home/code/src/cmake/Source/CursesDialog/form"
- "buildDirectory":"/tmp/cmake-build-test/Source/CursesDialog/form",
- "configurations":
- [
+ "name": "",
+ "projects": [
{
- "name":"",
- "targets":
- [
+ "buildDirectory": "/tmp/build/Source/CursesDialog/form",
+ "name": "CMAKE_FORM",
+ "sourceDirectory": "/home/code/src/cmake/Source/CursesDialog/form",
+ "targets": [
{
- "artifactDirectory":"/tmp/cmake/Source/CursesDialog/form",
- "fileGroups":
- [
+ "artifacts": [ "/tmp/build/Source/CursesDialog/form/libcmForm.a" ],
+ "buildDirectory": "/tmp/build/Source/CursesDialog/form",
+ "fileGroups": [
{
- "compileFlags":" -std=gnu11",
- "defines":
- [
- "SOMETHING=1",
- "LIBARCHIVE_STATIC"
- ],
- "includePath":
- [
- { "path":"/tmp/cmake-build-test/Utilities" },
- { "isSystem": true, "path":"/usr/include/something" },
- ...
- ]
- "language":"C",
- "sources":
- [
- "fld_arg.c",
- ...
- "fty_regex.c"
- ]
+ "compileFlags": " -std=gnu11",
+ "defines": [ "CURL_STATICLIB", "LIBARCHIVE_STATIC" ],
+ "includePath": [ { "path": "/tmp/build/Utilities" }, <...> ],
+ "isGenerated": false,
+ "language": "C",
+ "sources": [ "fld_arg.c", <...> ]
}
],
- "fullName":"libcmForm.a",
- "linkerLanguage":"C",
- "name":"cmForm",
- "type":"STATIC_LIBRARY"
+ "fullName": "libcmForm.a",
+ "linkerLanguage": "C",
+ "name": "cmForm",
+ "sourceDirectory": "/home/code/src/cmake/Source/CursesDialog/form",
+ "type": "STATIC_LIBRARY"
}
]
- }
- ],
- },
- ...
- ]
+ },
+ <...>
+ ]
+ }
+ ],
+ "cookie": "",
+ "inReplyTo": "codemodel",
+ "type": "reply"
}
]== CMake Server ==]
-The output can be tailored to the specific needs via parameter passed when
-requesting "project" information.
-
-You can have a "depth" key, which accepts "project", "configuration" and
-"target" as string values. These cause the output to be trimmed at the
-appropriate depth of the output tree.
-
-You can also set "configurations" to an array of strings with configuration
-names to list. This will cause any configuration that is not listed to be
-trimmed from the output.
-
-Generated files can be included in the listing by setting "includeGeneratedFiles"
-to "true". This setting defaults to "false", so generated files are not
-listed by default.
-
-Finally you can limit the target types that are going to be listed. This is
-done by providing a list of target types as an array of strings to the
-"targetTypes" key.
-
Type "cmakeInputs"
^^^^^^^^^^^^^^^^^^
diff --git a/Modules/Platform/Android-Common.cmake b/Modules/Platform/Android-Common.cmake
index 6544696..8755d4f 100644
--- a/Modules/Platform/Android-Common.cmake
+++ b/Modules/Platform/Android-Common.cmake
@@ -107,6 +107,7 @@ set(_ANDROID_ABI_INIT_CFLAGS "")
set(_ANDROID_ABI_INIT_CFLAGS_DEBUG "")
set(_ANDROID_ABI_INIT_CFLAGS_RELEASE "")
set(_ANDROID_ABI_INIT_LDFLAGS "")
+set(_ANDROID_ABI_INIT_EXE_LDFLAGS "")
macro(__android_compiler_common lang)
if(_ANDROID_ABI_INIT_CFLAGS)
@@ -125,6 +126,9 @@ macro(__android_compiler_common lang)
string(APPEND CMAKE_${t}_LINKER_FLAGS_INIT " ${_ANDROID_ABI_INIT_LDFLAGS}")
endforeach()
endif()
+ if(_ANDROID_ABI_INIT_EXE_LDFLAGS)
+ string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ${_ANDROID_ABI_INIT_EXE_LDFLAGS}")
+ endif()
if(DEFINED _ANDROID_STL_EXCEPTIONS)
if(_ANDROID_STL_EXCEPTIONS)
diff --git a/Modules/Platform/Android/abi-arm64-v8a-Clang.cmake b/Modules/Platform/Android/abi-arm64-v8a-Clang.cmake
index 3ff1fe5..f4717d5 100644
--- a/Modules/Platform/Android/abi-arm64-v8a-Clang.cmake
+++ b/Modules/Platform/Android/abi-arm64-v8a-Clang.cmake
@@ -1,8 +1,7 @@
# <ndk>/build/core/toolchains/aarch64-linux-android-clang/setup.mk
set(_ANDROID_ABI_CLANG_TARGET "aarch64-none-linux-android")
-string(APPEND _ANDROID_ABI_INIT_CFLAGS
- " -fpic"
- )
+# Suppress -Wl,-z,nocopyreloc flag on arm64-v8a
+set(_ANDROID_ABI_INIT_EXE_LDFLAGS_NO_nocopyreloc 1)
include(Platform/Android/abi-common-Clang)
diff --git a/Modules/Platform/Android/abi-arm64-v8a-GNU.cmake b/Modules/Platform/Android/abi-arm64-v8a-GNU.cmake
index 538ec2f..b71a674 100644
--- a/Modules/Platform/Android/abi-arm64-v8a-GNU.cmake
+++ b/Modules/Platform/Android/abi-arm64-v8a-GNU.cmake
@@ -1,6 +1,6 @@
# <ndk>/build/core/toolchains/aarch64-linux-android-4.9/setup.mk
-string(APPEND _ANDROID_ABI_INIT_CFLAGS
- " -fpic"
- )
+
+# Suppress -Wl,-z,nocopyreloc flag on arm64-v8a
+set(_ANDROID_ABI_INIT_EXE_LDFLAGS_NO_nocopyreloc 1)
include(Platform/Android/abi-common-GNU)
diff --git a/Modules/Platform/Android/abi-armeabi-Clang.cmake b/Modules/Platform/Android/abi-armeabi-Clang.cmake
index 4fc3009..b857bd3 100644
--- a/Modules/Platform/Android/abi-armeabi-Clang.cmake
+++ b/Modules/Platform/Android/abi-armeabi-Clang.cmake
@@ -14,7 +14,6 @@ endif()
string(APPEND _ANDROID_ABI_INIT_CFLAGS
" -msoft-float"
" -mtune=xscale"
- " -fpic"
)
include(Platform/Android/abi-common-Clang)
diff --git a/Modules/Platform/Android/abi-armeabi-GNU.cmake b/Modules/Platform/Android/abi-armeabi-GNU.cmake
index 10cac00..33e8b31 100644
--- a/Modules/Platform/Android/abi-armeabi-GNU.cmake
+++ b/Modules/Platform/Android/abi-armeabi-GNU.cmake
@@ -12,7 +12,6 @@ endif()
string(APPEND _ANDROID_ABI_INIT_CFLAGS
" -msoft-float"
" -mtune=xscale"
- " -fpic"
)
include(Platform/Android/abi-common-GNU)
diff --git a/Modules/Platform/Android/abi-armeabi-v6-Clang.cmake b/Modules/Platform/Android/abi-armeabi-v6-Clang.cmake
index 15f1d4a..a7412f5 100644
--- a/Modules/Platform/Android/abi-armeabi-v6-Clang.cmake
+++ b/Modules/Platform/Android/abi-armeabi-v6-Clang.cmake
@@ -13,7 +13,6 @@ endif()
string(APPEND _ANDROID_ABI_INIT_CFLAGS
" -mfloat-abi=softfp"
- " -fpic"
)
include(Platform/Android/abi-common-Clang)
diff --git a/Modules/Platform/Android/abi-armeabi-v6-GNU.cmake b/Modules/Platform/Android/abi-armeabi-v6-GNU.cmake
index 7492de0..1fda184 100644
--- a/Modules/Platform/Android/abi-armeabi-v6-GNU.cmake
+++ b/Modules/Platform/Android/abi-armeabi-v6-GNU.cmake
@@ -11,7 +11,6 @@ endif()
string(APPEND _ANDROID_ABI_INIT_CFLAGS
" -mfloat-abi=softfp"
- " -fpic"
)
include(Platform/Android/abi-common-GNU)
diff --git a/Modules/Platform/Android/abi-armeabi-v7a-Clang.cmake b/Modules/Platform/Android/abi-armeabi-v7a-Clang.cmake
index 3a3efb3..e2ab58b 100644
--- a/Modules/Platform/Android/abi-armeabi-v7a-Clang.cmake
+++ b/Modules/Platform/Android/abi-armeabi-v7a-Clang.cmake
@@ -23,7 +23,6 @@ string(APPEND _ANDROID_ABI_INIT_LDFLAGS
string(APPEND _ANDROID_ABI_INIT_CFLAGS
" -mfloat-abi=softfp"
- " -fpic"
)
include(Platform/Android/abi-common-Clang)
diff --git a/Modules/Platform/Android/abi-armeabi-v7a-GNU.cmake b/Modules/Platform/Android/abi-armeabi-v7a-GNU.cmake
index d27e37e..b7c328d 100644
--- a/Modules/Platform/Android/abi-armeabi-v7a-GNU.cmake
+++ b/Modules/Platform/Android/abi-armeabi-v7a-GNU.cmake
@@ -17,7 +17,6 @@ endif()
string(APPEND _ANDROID_ABI_INIT_CFLAGS
" -mfloat-abi=softfp"
- " -fpic"
)
string(APPEND _ANDROID_ABI_INIT_LDFLAGS
diff --git a/Modules/Platform/Android/abi-common.cmake b/Modules/Platform/Android/abi-common.cmake
index 12d8e5c..3b0eb01 100644
--- a/Modules/Platform/Android/abi-common.cmake
+++ b/Modules/Platform/Android/abi-common.cmake
@@ -2,3 +2,18 @@ string(APPEND _ANDROID_ABI_INIT_CFLAGS
" -funwind-tables"
" -no-canonical-prefixes"
)
+
+if(NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE
+ AND NOT CMAKE_SYSTEM_VERSION VERSION_LESS 16)
+ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+endif()
+
+if(CMAKE_POSITION_INDEPENDENT_CODE)
+ string(APPEND _ANDROID_ABI_INIT_EXE_LDFLAGS " -fPIE -pie")
+endif()
+
+string(APPEND _ANDROID_ABI_INIT_EXE_LDFLAGS " -Wl,--gc-sections")
+
+if(NOT _ANDROID_ABI_INIT_EXE_LDFLAGS_NO_nocopyreloc)
+ string(APPEND _ANDROID_ABI_INIT_EXE_LDFLAGS " -Wl,-z,nocopyreloc")
+endif()
diff --git a/Modules/Platform/Android/abi-mips-Clang.cmake b/Modules/Platform/Android/abi-mips-Clang.cmake
index bf6b9fc..73addde 100644
--- a/Modules/Platform/Android/abi-mips-Clang.cmake
+++ b/Modules/Platform/Android/abi-mips-Clang.cmake
@@ -1,8 +1,4 @@
# <ndk>/build/core/toolchains/mipsel-linux-android-clang/setup.mk
set(_ANDROID_ABI_CLANG_TARGET "mipsel-none-linux-android")
-string(APPEND _ANDROID_ABI_INIT_CFLAGS
- " -fpic"
- )
-
include(Platform/Android/abi-common-Clang)
diff --git a/Modules/Platform/Android/abi-mips-GNU.cmake b/Modules/Platform/Android/abi-mips-GNU.cmake
index d380440..982ad46 100644
--- a/Modules/Platform/Android/abi-mips-GNU.cmake
+++ b/Modules/Platform/Android/abi-mips-GNU.cmake
@@ -1,6 +1,3 @@
# <ndk>/build/core/toolchains/mipsel-linux-android-4.9/setup.mk
-string(APPEND _ANDROID_ABI_INIT_CFLAGS
- " -fpic"
- )
include(Platform/Android/abi-common-GNU)
diff --git a/Modules/Platform/Android/abi-mips64-Clang.cmake b/Modules/Platform/Android/abi-mips64-Clang.cmake
index 1a94107..603f1b2 100644
--- a/Modules/Platform/Android/abi-mips64-Clang.cmake
+++ b/Modules/Platform/Android/abi-mips64-Clang.cmake
@@ -1,8 +1,4 @@
# <ndk>/build/core/toolchains/mips64el-linux-android-clang/setup.mk
set(_ANDROID_ABI_CLANG_TARGET "mips64el-none-linux-android")
-string(APPEND _ANDROID_ABI_INIT_CFLAGS
- " -fpic"
- )
-
include(Platform/Android/abi-common-Clang)
diff --git a/Modules/Platform/Android/abi-mips64-GNU.cmake b/Modules/Platform/Android/abi-mips64-GNU.cmake
index 4525d40..a1bc2c2 100644
--- a/Modules/Platform/Android/abi-mips64-GNU.cmake
+++ b/Modules/Platform/Android/abi-mips64-GNU.cmake
@@ -1,6 +1,3 @@
# <ndk>/build/core/toolchains/mips64el-linux-android-4.9/setup.mk
-string(APPEND _ANDROID_ABI_INIT_CFLAGS
- " -fpic"
- )
include(Platform/Android/abi-common-GNU)
diff --git a/Modules/Platform/Android/abi-x86-Clang.cmake b/Modules/Platform/Android/abi-x86-Clang.cmake
index f63ed36..fe7eace 100644
--- a/Modules/Platform/Android/abi-x86-Clang.cmake
+++ b/Modules/Platform/Android/abi-x86-Clang.cmake
@@ -1,8 +1,4 @@
# <ndk>/build/core/toolchains/x86-clang/setup.mk
set(_ANDROID_ABI_CLANG_TARGET "i686-none-linux-android")
-string(APPEND _ANDROID_ABI_INIT_CFLAGS
- " -fPIC"
- )
-
include(Platform/Android/abi-common-Clang)
diff --git a/Modules/Platform/Android/abi-x86_64-Clang.cmake b/Modules/Platform/Android/abi-x86_64-Clang.cmake
index c15042b..3cbcd49 100644
--- a/Modules/Platform/Android/abi-x86_64-Clang.cmake
+++ b/Modules/Platform/Android/abi-x86_64-Clang.cmake
@@ -1,8 +1,4 @@
# <ndk>/build/core/toolchains/x86_64-clang/setup.mk
set(_ANDROID_ABI_CLANG_TARGET "x86_64-none-linux-android")
-string(APPEND _ANDROID_ABI_INIT_CFLAGS
- " -fPIC"
- )
-
include(Platform/Android/abi-common-Clang)
diff --git a/Modules/Platform/Android/ndk-stl-c++_static.cmake b/Modules/Platform/Android/ndk-stl-c++_static.cmake
index 8e562f8..061a5c2 100644
--- a/Modules/Platform/Android/ndk-stl-c++_static.cmake
+++ b/Modules/Platform/Android/ndk-stl-c++_static.cmake
@@ -3,4 +3,6 @@ macro(__android_stl lang)
__android_stl_cxx(${lang} libc++_static.a)
__android_stl_lib(${lang} "${CMAKE_ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libs/${CMAKE_ANDROID_ARCH_ABI}/libc++abi.a" 0)
__android_stl_lib(${lang} "${CMAKE_ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libs/${CMAKE_ANDROID_ARCH_ABI}/libandroid_support.a" 0)
+ __android_stl_lib(${lang} "${CMAKE_ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libs/${CMAKE_ANDROID_ARCH_ABI}/libunwind.a" 0)
+ string(APPEND CMAKE_${lang}_STANDARD_LIBRARIES " -latomic") # provided by toolchain
endmacro()
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index f5a0e68..5e6036d 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -843,20 +843,6 @@ std::string cmGlobalNinjaGenerator::ConvertToNinjaPath(const std::string& path)
return convPath;
}
-std::string cmGlobalNinjaGenerator::ConvertToNinjaFolderRule(
- const std::string& path)
-{
- cmLocalNinjaGenerator* ng =
- static_cast<cmLocalNinjaGenerator*>(this->LocalGenerators[0]);
- std::string convPath = ng->ConvertToRelativePath(
- this->LocalGenerators[0]->GetState()->GetSourceDirectory(), path + "/all");
- convPath = this->NinjaOutputPath(convPath);
-#ifdef _WIN32
- std::replace(convPath.begin(), convPath.end(), '/', '\\');
-#endif
- return convPath;
-}
-
void cmGlobalNinjaGenerator::AddCXXCompileCommand(
const std::string& commandLine, const std::string& sourceFile)
{
@@ -1083,11 +1069,11 @@ void cmGlobalNinjaGenerator::WriteFolderTargets(std::ostream& os)
this->LocalGenerators.begin();
lgi != this->LocalGenerators.end(); ++lgi) {
cmLocalGenerator const* lg = *lgi;
- const std::string currentSourceFolder(
- lg->GetStateSnapshot().GetDirectory().GetCurrentSource());
+ const std::string currentBinaryFolder(
+ lg->GetStateSnapshot().GetDirectory().GetCurrentBinary());
// The directory-level rule should depend on the target-level rules
// for all targets in the directory.
- targetsPerFolder[currentSourceFolder] = cmNinjaDeps();
+ targetsPerFolder[currentBinaryFolder] = cmNinjaDeps();
for (std::vector<cmGeneratorTarget*>::const_iterator ti =
lg->GetGeneratorTargets().begin();
ti != lg->GetGeneratorTargets().end(); ++ti) {
@@ -1098,7 +1084,7 @@ void cmGlobalNinjaGenerator::WriteFolderTargets(std::ostream& os)
type == cmState::MODULE_LIBRARY ||
type == cmState::OBJECT_LIBRARY || type == cmState::UTILITY) &&
!gt->GetPropertyAsBool("EXCLUDE_FROM_ALL")) {
- targetsPerFolder[currentSourceFolder].push_back(gt->GetName());
+ targetsPerFolder[currentBinaryFolder].push_back(gt->GetName());
}
}
@@ -1109,28 +1095,30 @@ void cmGlobalNinjaGenerator::WriteFolderTargets(std::ostream& os)
for (std::vector<cmState::Snapshot>::const_iterator stateIt =
children.begin();
stateIt != children.end(); ++stateIt) {
- targetsPerFolder[currentSourceFolder].push_back(
- this->ConvertToNinjaFolderRule(
- stateIt->GetDirectory().GetCurrentSource()));
+ std::string const currentBinaryDir =
+ stateIt->GetDirectory().GetCurrentBinary();
+
+ targetsPerFolder[currentBinaryFolder].push_back(
+ this->ConvertToNinjaPath(currentBinaryDir + "/all"));
}
}
- std::string const rootSourceDir =
- this->LocalGenerators[0]->GetSourceDirectory();
+ std::string const rootBinaryDir =
+ this->LocalGenerators[0]->GetBinaryDirectory();
for (std::map<std::string, cmNinjaDeps>::const_iterator it =
targetsPerFolder.begin();
it != targetsPerFolder.end(); ++it) {
cmGlobalNinjaGenerator::WriteDivider(os);
- std::string const& currentSourceDir = it->first;
+ std::string const& currentBinaryDir = it->first;
- // Do not generate a rule for the root source dir.
- if (rootSourceDir.length() >= currentSourceDir.length()) {
+ // Do not generate a rule for the root binary dir.
+ if (rootBinaryDir.length() >= currentBinaryDir.length()) {
continue;
}
- std::string const comment = "Folder: " + currentSourceDir;
+ std::string const comment = "Folder: " + currentBinaryDir;
cmNinjaDeps output(1);
- output.push_back(this->ConvertToNinjaFolderRule(currentSourceDir));
+ output.push_back(this->ConvertToNinjaPath(currentBinaryDir + "/all"));
this->WritePhonyBuild(os, comment, output, it->second);
}
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index dcf7406..2ce3c80 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -234,7 +234,6 @@ public:
}
std::string ConvertToNinjaPath(const std::string& path);
- std::string ConvertToNinjaFolderRule(const std::string& path);
struct MapToNinjaPathImpl
{
diff --git a/Tests/RunCMake/Android/RunCMakeTest.cmake b/Tests/RunCMake/Android/RunCMakeTest.cmake
index 39b77cd..86a9896 100644
--- a/Tests/RunCMake/Android/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Android/RunCMakeTest.cmake
@@ -174,11 +174,6 @@ foreach(ndk IN LISTS TEST_ANDROID_NDK)
continue()
endif()
- # Skip combinations that seem to be broken.
- if("${stl};${abi}" MATCHES [[^c\+\+_static;armeabi]])
- continue()
- endif()
-
# Run the tests for this combination.
if("${abi}" STREQUAL "armeabi")
run_Android(ndk-armeabi-thumb) # default: -DCMAKE_ANDROID_ARCH_ABI=armeabi -DCMAKE_ANDROID_ARM_MODE=0
diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
index 778f2c1..1d3639d 100644
--- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
@@ -45,14 +45,23 @@ function(run_SubDir)
set(SubDir_all [[SubDir\all]])
set(SubDir_test [[SubDir\test]])
set(SubDir_install [[SubDir\install]])
+ set(SubDirBinary_test [[SubDirBinary\test]])
+ set(SubDirBinary_all [[SubDirBinary\all]])
+ set(SubDirBinary_install [[SubDirBinary\install]])
else()
set(SubDir_all [[SubDir/all]])
set(SubDir_test [[SubDir/test]])
set(SubDir_install [[SubDir/install]])
+ set(SubDirBinary_all [[SubDirBinary/all]])
+ set(SubDirBinary_test [[SubDirBinary/test]])
+ set(SubDirBinary_install [[SubDirBinary/install]])
endif()
run_cmake_command(SubDir-build ${CMAKE_COMMAND} --build . --target ${SubDir_all})
run_cmake_command(SubDir-test ${CMAKE_COMMAND} --build . --target ${SubDir_test})
run_cmake_command(SubDir-install ${CMAKE_COMMAND} --build . --target ${SubDir_install})
+ run_cmake_command(SubDirBinary-build ${CMAKE_COMMAND} --build . --target ${SubDirBinary_all})
+ run_cmake_command(SubDirBinary-test ${CMAKE_COMMAND} --build . --target ${SubDirBinary_test})
+ run_cmake_command(SubDirBinary-install ${CMAKE_COMMAND} --build . --target ${SubDirBinary_install})
endfunction()
run_SubDir()
diff --git a/Tests/RunCMake/Ninja/SubDir.cmake b/Tests/RunCMake/Ninja/SubDir.cmake
index d227753..11f467a 100644
--- a/Tests/RunCMake/Ninja/SubDir.cmake
+++ b/Tests/RunCMake/Ninja/SubDir.cmake
@@ -1,5 +1,6 @@
include(CTest)
add_subdirectory(SubDir)
+add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/SubDirSource SubDirBinary)
add_custom_target(TopFail ALL COMMAND does_not_exist)
add_test(NAME TopTest COMMAND ${CMAKE_COMMAND} -E echo "Running TopTest")
install(CODE [[
diff --git a/Tests/RunCMake/Ninja/SubDirBinary-build-stdout.txt b/Tests/RunCMake/Ninja/SubDirBinary-build-stdout.txt
new file mode 100644
index 0000000..244eaa0
--- /dev/null
+++ b/Tests/RunCMake/Ninja/SubDirBinary-build-stdout.txt
@@ -0,0 +1 @@
+Building SubDirSourceInAll
diff --git a/Tests/RunCMake/Ninja/SubDirBinary-install-stdout.txt b/Tests/RunCMake/Ninja/SubDirBinary-install-stdout.txt
new file mode 100644
index 0000000..6b6c6dd
--- /dev/null
+++ b/Tests/RunCMake/Ninja/SubDirBinary-install-stdout.txt
@@ -0,0 +1 @@
+-- Installing SubDirSource
diff --git a/Tests/RunCMake/Ninja/SubDirBinary-test-stdout.txt b/Tests/RunCMake/Ninja/SubDirBinary-test-stdout.txt
new file mode 100644
index 0000000..d6d6605
--- /dev/null
+++ b/Tests/RunCMake/Ninja/SubDirBinary-test-stdout.txt
@@ -0,0 +1 @@
+1/1 Test #1: SubDirSourceTest
diff --git a/Tests/RunCMake/Ninja/SubDirSource/CMakeLists.txt b/Tests/RunCMake/Ninja/SubDirSource/CMakeLists.txt
new file mode 100644
index 0000000..2664261
--- /dev/null
+++ b/Tests/RunCMake/Ninja/SubDirSource/CMakeLists.txt
@@ -0,0 +1,6 @@
+add_custom_target(SubDirSourceFail COMMAND does_not_exist)
+add_custom_target(SubDirSourceInAll ALL COMMAND ${CMAKE_COMMAND} -E echo "Building SubDirSourceInAll")
+add_test(NAME SubDirSourceTest COMMAND ${CMAKE_COMMAND} -E echo "Running SubDirSourceTest")
+install(CODE [[
+ message(STATUS "Installing SubDirSource")
+]])