mirror of
https://git.mirrors.martin98.com/https://github.com/google/draco
synced 2025-08-16 14:05:57 +08:00
Merge branch 'master' into v157_snapshot
This commit is contained in:
commit
dcce9d0b3a
@ -23,6 +23,7 @@ include(GNUInstallDirs)
|
||||
# Sets up the draco install targets. Must be called after the static library
|
||||
# target is created.
|
||||
macro(draco_setup_install_target)
|
||||
if(DRACO_INSTALL)
|
||||
set(bin_path "${CMAKE_INSTALL_BINDIR}")
|
||||
set(data_path "${CMAKE_INSTALL_DATAROOTDIR}")
|
||||
set(includes_path "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
@ -118,4 +119,5 @@ macro(draco_setup_install_target)
|
||||
install(FILES "${draco_build}/draco-config.cmake"
|
||||
"${draco_build}/draco-config-version.cmake"
|
||||
DESTINATION "${data_path}/cmake/draco")
|
||||
endif(DRACO_INSTALL)
|
||||
endmacro()
|
||||
|
@ -131,6 +131,10 @@ macro(draco_set_default_options)
|
||||
NAME DRACO_DEBUG_COMPILER_WARNINGS
|
||||
HELPSTRING "Turn on more warnings."
|
||||
VALUE OFF)
|
||||
draco_option(
|
||||
NAME DRACO_INSTALL
|
||||
HELPSTRING "Enable installation."
|
||||
VALUE ON)
|
||||
draco_check_deprecated_options()
|
||||
endmacro()
|
||||
|
||||
|
@ -38,11 +38,10 @@ bool DirectoryExists(const std::string &path_arg) {
|
||||
struct stat path_stat;
|
||||
std::string path = path_arg;
|
||||
|
||||
#if defined(_WIN32) && not defined(__MINGW32__)
|
||||
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||
// Avoid a silly windows issue: stat() will fail on a drive letter missing the
|
||||
// trailing slash.
|
||||
if (path.size() > 0 && path[path.size()] != '\\' &&
|
||||
path[path.size()] != '/') {
|
||||
// trailing slash. To keep it simple, append a path separator to all paths.
|
||||
if (!path.empty() && path.back() != '\\' && path.back() != '/') {
|
||||
path.append("\\");
|
||||
}
|
||||
#endif
|
||||
@ -68,9 +67,7 @@ bool CheckAndCreatePathForFile(const std::string &filename) {
|
||||
const ghc::filesystem::path ghc_path(path);
|
||||
ghc::filesystem::create_directories(ghc_path);
|
||||
#endif // DRACO_TRANSCODER_SUPPORTED
|
||||
const bool directory_exists = DirectoryExists(path);
|
||||
|
||||
return directory_exists;
|
||||
return DirectoryExists(path);
|
||||
}
|
||||
|
||||
} // namespace draco
|
||||
|
Loading…
x
Reference in New Issue
Block a user