Commit Graph

6 Commits

Author SHA1 Message Date
Celtic Minstrel
959c616f05 add_source_file: Fix failure to add Boost unit tests to Xcode 2024-08-06 09:51:54 -04:00
Steve Cotton
35dbaa472e Clarify whether add_source_file should add .hpp files
Only add files that were named on the command line, don't implicitly
add a .hpp file when the .cpp file was given. Previously the script
both needed the .hpp (for Xcode) and failed when the .hpp was given
(for CodeBlocks).

Add the following checks, and if any of them fail exit before making
any changes. Also add a --no-checks option to proceed anyway.

* Check the files exist
* If a .cpp is given and the .hpp exists, check it was given too.
* If a .hpp is given and the .cpp exists, check it was given too.

For the files used by CMake and SCons, .hpp files were never added,
and they still won't be.
2024-01-30 08:41:26 +00:00
Steve Cotton
866d1a7a6e Use argparse for add_source_file
Treat an argument of "--help" as a request to print help, instead of a filename
to add to the source lists.

Treat the arguments "src/foo.cpp" "src/foo.hpp" as two filenames, instead of
adding src/foo.cpp to target src/foo.hpp. The old command line

    ./add_source_file a b c

becomes

    ./add_source_file a --target b --target c

When saying that pbxproj is required, suggest optionally using a venv instead
of installing systemwide.
2024-01-26 12:03:05 +00:00
gfgtdf
8710ae0ee6 try to fix add_source_file 2023-03-18 19:04:39 +01:00
Pentarctagon
34369f62d2 Fix a couple issues with add_source_file. 2022-08-24 20:36:59 -05:00
Tommy
4d5d61f47c
A script to add new source files (#6948)
Usage: ./add_source_file <filename> [target ...]

Targets are "wesnoth", "wesnothd", "campaignd", "lua", "tests".
It defaults to the "wesnoth" target.

The 'pbxproj' python package is required to modify the Xcode project.

[ci skip]
2022-08-16 11:47:17 -05:00