Advertisement

CMake: Disable install()

Started by October 27, 2024 06:27 PM
26 comments, last by 1vanK 3 weeks, 3 days ago

I add AngelScript repository as a git submodule and include CMakeLists.txt

add_subdirectory(repo/sdk/angelscript/projects/cmake)

Please make install() optional so that I could do this:

set(ANGELSCRIPT_DISABLE_INSTALL ON CACHE BOOL "" FORCE)
add_subdirectory(repo/sdk/angelscript/projects/cmake)

Can you provide a patch for this? I'm not very good with cmake.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement
option(AS_DISABLE_INSTALL    “Disable installation of AngelScript” OFF)

if(NOT AS_DISABLE_INSTALL)
    install(…)
endif()

Thanks. I'll add it to the repository.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

VS warning:

Building Custom Rule D:/a/sprite_manipulator/sprite_manipulator/repo/angelscript/repo/sdk/angelscript/projects/cmake/CMakeLists.txt 
Assembling D:\a\sprite_manipulator\sprite_manipulator\repo\angelscript\repo\sdk\angelscript\source\as_callfunc_x64_msvc_asm.asm... 
MASM : warning A4018: invalid command-line option : /MP [D:\a\sprite_manipulator\sprite_manipulator\build\angelscript\repo\sdk\angelscript\projects\cmake\angelscript.vcxproj]

Mingw warning:

[ 3%] Building CXX object angelscript/repo/sdk/angelscript/projects/cmake/CMakeFiles/angelscript.dir/__/__/source/as_callfunc_x64_mingw.cpp.obj 
D:\a\sprite_manipulator\sprite_manipulator\repo\angelscript\repo\sdk\angelscript\source\as_callfunc_x64_mingw.cpp: In function 'asQWORD CallX64(const asQWORD*, const asQWORD*, int, asQWORD)': 
D:\a\sprite_manipulator\sprite_manipulator\repo\angelscript\repo\sdk\angelscript\source\as_callfunc_x64_mingw.cpp:55:9: warning: listing the stack pointer register 'rsp' in a clobber list is deprecated [-Wdeprecated] 
55 | __asm__ __volatile__ ( 
| ^~~~~~~ 
D:\a\sprite_manipulator\sprite_manipulator\repo\angelscript\repo\sdk\angelscript\source\as_callfunc_x64_mingw.cpp:55:9: note: the value of the stack pointer after an 'asm' statement must be the same as it was before the statement

May be something like this

add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/MP>)

(not tested)

Advertisement

I've never used cmake on Windows. However, I'll accept patches for improving the makefiles🙂

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Replace in sdk\angelscript\projects\cmake\CMakeLists.txt


if(MSVC AND MSVC_COMPILE_FLAGS)
    target_compile_options(${ANGELSCRIPT_LIBRARY_NAME} PRIVATE "${MSVC_COMPILE_FLAGS}")
endif()

to

if(MSVC AND MSVC_COMPILE_FLAGS)
    target_compile_options(${ANGELSCRIPT_LIBRARY_NAME} PRIVATE $<$<COMPILE_LANGUAGE:C,CXX>:${MSVC_COMPILE_FLAGS}>)
endif()

Don't want to move the project to GitHub? There you can set up automatic compilation and launch of the project on Linux/MacOS/Windows after each commit

Interesting. I didn't know about those capabilities on GitHub. I'll look into it.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement