cmake: tweak to avoid permission failure on linux

This commit is contained in:
bnnm 2021-08-12 20:02:32 +02:00
parent a36edd592b
commit 9407cda157
2 changed files with 9 additions and 4 deletions

View File

@ -85,12 +85,16 @@ endif()
# Set autogenerated version # Set autogenerated version
if(MSVC) if(MSVC)
set(VGM_VERSION_GENERATOR version-make.bat) set(VGM_VERSION_GENERATOR version-make.bat)
else()
set(VGM_VERSION_GENERATOR version-make.sh)
endif()
add_custom_command(OUTPUT ${VGM_SOURCE_DIR}/version_auto.h add_custom_command(OUTPUT ${VGM_SOURCE_DIR}/version_auto.h
COMMAND "${VGM_SOURCE_DIR}/${VGM_VERSION_GENERATOR}" COMMAND "${VGM_SOURCE_DIR}/${VGM_VERSION_GENERATOR}"
DEPENDS ${VGM_SOURCE_DIR}/${VGM_VERSION_GENERATOR}) DEPENDS ${VGM_SOURCE_DIR}/${VGM_VERSION_GENERATOR})
else()
# linux uses 'sh' so git-less (src zip) builds can run without chmod -x (script)
set(VGM_VERSION_GENERATOR version-make.sh)
add_custom_command(OUTPUT ${VGM_SOURCE_DIR}/version_auto.h
COMMAND sh "${VGM_SOURCE_DIR}/${VGM_VERSION_GENERATOR}"
DEPENDS ${VGM_SOURCE_DIR}/${VGM_VERSION_GENERATOR})
endif()
add_custom_target(version_h ALL DEPENDS ${VGM_SOURCE_DIR}/version_auto.h) add_custom_target(version_h ALL DEPENDS ${VGM_SOURCE_DIR}/version_auto.h)
# FFmpeg detection # FFmpeg detection

View File

@ -80,6 +80,7 @@ sudo apt-get install -y git
git clone https://github.com/vgmstream/vgmstream git clone https://github.com/vgmstream/vgmstream
cd vgmstream cd vgmstream
# in case they weren't set
chmod +x version-get.sh version-make.sh make-build.sh chmod +x version-get.sh version-make.sh make-build.sh
# warning: installs stuff, check all "apt install" # warning: installs stuff, check all "apt install"
@ -92,7 +93,7 @@ Tool used to generate common build files (for *make*, *VS/MSBuild*, etc), that i
If you wish to use CMake see [CMAKE.md](CMAKE.md). Some extra info is only mentioned in this doc though. If you wish to use CMake see [CMAKE.md](CMAKE.md). Some extra info is only mentioned in this doc though.
Note that doing in-source builds of CMake (`cmake .` / selecting `./vgmstream` as output dir) is not recommended and may clobber default build files. Note that doing in-source builds of CMake (`cmake .` / selecting `./vgmstream` as output dir) is not recommended and may clobber default build files (try `cmake -S . -B build` / using some `./build` subfolder).
### autotools (builds) ### autotools (builds)
Autogenerated *make* scripts, used by some modules (mainly Audacious for Linux, and external libs). Autogenerated *make* scripts, used by some modules (mainly Audacious for Linux, and external libs).