mirror of https://github.com/OpenTTD/OpenTTD
Codechange: generate .h instead of .hpp
parent
c7d5cedc7b
commit
39fa014d76
|
@ -26,7 +26,7 @@
|
|||
#include "../script/api/template/template_text.hpp.sq"
|
||||
|
||||
/* Convert all AI related classes to Squirrel data. */
|
||||
#include "../script/api/ai/ai_includes.hpp"
|
||||
#include "../script/api/ai/ai_includes.h"
|
||||
|
||||
#include "../company_base.h"
|
||||
#include "../company_func.h"
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include "game.hpp"
|
||||
|
||||
/* Convert all Game related classes to Squirrel data. */
|
||||
#include "../script/api/game/game_includes.hpp"
|
||||
#include "../script/api/game/game_includes.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@ add_library(script_api
|
|||
INTERFACE
|
||||
)
|
||||
|
||||
# Get script_window.hpp dependencies
|
||||
file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/script_window.hpp.in ENUM_LINES REGEX "@enum")
|
||||
# Get script_window.h dependencies
|
||||
file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/script_window.h.in ENUM_LINES REGEX "@enum")
|
||||
foreach(ENUM IN LISTS ENUM_LINES)
|
||||
string(REGEX REPLACE ".* ([^ @]+)@.*" "\\1" FILE_PATTERN "${ENUM}")
|
||||
file(GLOB FILENAMES "${FILE_PATTERN}")
|
||||
|
@ -11,20 +11,20 @@ foreach(ENUM IN LISTS ENUM_LINES)
|
|||
endforeach()
|
||||
list(REMOVE_DUPLICATES DEPENDENCIES)
|
||||
|
||||
# Add a command to generate script_window.hpp
|
||||
add_custom_command_timestamp(OUTPUT ${CMAKE_BINARY_DIR}/generated/script/api/script_window.hpp
|
||||
# Add a command to generate script_window.h
|
||||
add_custom_command_timestamp(OUTPUT ${CMAKE_BINARY_DIR}/generated/script/api/script_window.h
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-DGENERATE_SOURCE_FILE=${CMAKE_CURRENT_SOURCE_DIR}/script_window.hpp.in
|
||||
-DGENERATE_BINARY_FILE=${CMAKE_BINARY_DIR}/generated/script/api/script_window.hpp
|
||||
-DGENERATE_SOURCE_FILE=${CMAKE_CURRENT_SOURCE_DIR}/script_window.h.in
|
||||
-DGENERATE_BINARY_FILE=${CMAKE_BINARY_DIR}/generated/script/api/script_window.h
|
||||
-P ${CMAKE_SOURCE_DIR}/cmake/scripts/GenerateWidget.cmake
|
||||
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/script_window.hpp.in
|
||||
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/script_window.h.in
|
||||
DEPENDS ${CMAKE_SOURCE_DIR}/cmake/scripts/GenerateWidget.cmake ${DEPENDENCIES}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
COMMENT "Generating script_window.hpp"
|
||||
COMMENT "Generating script_window.h"
|
||||
)
|
||||
add_custom_target_timestamp(script_window
|
||||
DEPENDS
|
||||
${CMAKE_BINARY_DIR}/generated/script/api/script_window.hpp
|
||||
${CMAKE_BINARY_DIR}/generated/script/api/script_window.h
|
||||
)
|
||||
target_include_directories(script_api
|
||||
INTERFACE
|
||||
|
@ -33,7 +33,7 @@ target_include_directories(script_api
|
|||
)
|
||||
|
||||
file(GLOB SCRIPT_API_FILES "script_*.hpp")
|
||||
list(APPEND SCRIPT_API_FILES ${CMAKE_BINARY_DIR}/generated/script/api/script_window.hpp)
|
||||
list(APPEND SCRIPT_API_FILES ${CMAKE_BINARY_DIR}/generated/script/api/script_window.h)
|
||||
|
||||
foreach(API "ai;AI" "game;GS" "template;Template")
|
||||
list(GET API 0 APILC)
|
||||
|
@ -49,14 +49,14 @@ foreach(API "ai;AI" "game;GS" "template;Template")
|
|||
|
||||
add_custom_command_timestamp(OUTPUT ${SCRIPT_API_BINARY_FILE}
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-DSCRIPT_API_SOURCE_FILE=${CMAKE_CURRENT_SOURCE_DIR}/squirrel_export.hpp.sq.in
|
||||
-DSCRIPT_API_SOURCE_FILE=${CMAKE_CURRENT_SOURCE_DIR}/squirrel_export.h.sq.in
|
||||
-DSCRIPT_API_BINARY_FILE=${SCRIPT_API_BINARY_FILE}
|
||||
-DSCRIPT_API_FILE=${SCRIPT_API_FILE}
|
||||
-DAPIUC=${APIUC}
|
||||
-DAPILC=${APILC}
|
||||
-P ${CMAKE_SOURCE_DIR}/cmake/scripts/SquirrelExport.cmake
|
||||
MAIN_DEPENDENCY ${SCRIPT_API_FILE}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/squirrel_export.hpp.sq.in
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/squirrel_export.h.sq.in
|
||||
${CMAKE_SOURCE_DIR}/cmake/scripts/SquirrelExport.cmake
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Generating ${APILC}/${SCRIPT_API_FILE_NAME}.sq"
|
||||
|
@ -73,24 +73,24 @@ foreach(API "ai;AI" "game;GS" "template;Template")
|
|||
)
|
||||
|
||||
if(NOT "${APILC}" STREQUAL "template")
|
||||
list(APPEND SCRIPT_${APIUC}_BINARY_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${APILC}/${APILC}_controller.hpp.sq")
|
||||
set(INCLUDES_BINARY_FILE "${CMAKE_BINARY_DIR}/generated/script/api/${APILC}/${APILC}_includes.hpp")
|
||||
list(APPEND SCRIPT_${APIUC}_BINARY_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${APILC}/${APILC}_controller.h.sq")
|
||||
set(INCLUDES_BINARY_FILE "${CMAKE_BINARY_DIR}/generated/script/api/${APILC}/${APILC}_includes.h")
|
||||
set(API_FILES "${CMAKE_CURRENT_BINARY_DIR}/${APILC}.files")
|
||||
file(GENERATE OUTPUT ${API_FILES} CONTENT "${SCRIPT_${APIUC}_BINARY_FILES}")
|
||||
add_custom_command_timestamp(OUTPUT ${INCLUDES_BINARY_FILE}
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-DINCLUDES_SOURCE_FILE=${CMAKE_CURRENT_SOURCE_DIR}/script_includes.hpp.in
|
||||
-DINCLUDES_SOURCE_FILE=${CMAKE_CURRENT_SOURCE_DIR}/script_includes.h.in
|
||||
-DINCLUDES_BINARY_FILE=${INCLUDES_BINARY_FILE}
|
||||
-DAPIUC=${APIUC}
|
||||
-DAPILC=${APILC}
|
||||
-DAPI_FILES=${API_FILES}
|
||||
-P ${CMAKE_SOURCE_DIR}/cmake/scripts/SquirrelIncludes.cmake
|
||||
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/script_includes.hpp.in
|
||||
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/script_includes.h.in
|
||||
DEPENDS ${SCRIPT_${APIUC}_BINARY_FILES}
|
||||
${API_FILES}
|
||||
${CMAKE_SOURCE_DIR}/cmake/scripts/SquirrelIncludes.cmake
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Generating ${APILC}/${APILC}_includes.hpp"
|
||||
COMMENT "Generating ${APILC}/${APILC}_includes.h"
|
||||
)
|
||||
add_custom_target_timestamp(script_${APILC}_includes
|
||||
DEPENDS
|
||||
|
|
|
@ -97,7 +97,7 @@ FILE_PATTERNS = script_*.hpp \
|
|||
RECURSIVE = YES
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS = ai_includes.hpp
|
||||
EXCLUDE_PATTERNS = ai_includes.h
|
||||
EXCLUDE_SYMBOLS = GetClassName DECLARE_ENUM_AS_BIT_SET DECLARE_POSTFIX_INCREMENT
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATTERNS = *
|
||||
|
|
|
@ -97,7 +97,7 @@ FILE_PATTERNS = script_*.hpp \
|
|||
RECURSIVE = YES
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS = game_includes.hpp
|
||||
EXCLUDE_PATTERNS = game_includes.h
|
||||
EXCLUDE_SYMBOLS = GetClassName DECLARE_ENUM_AS_BIT_SET DECLARE_POSTFIX_INCREMENT
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATTERNS = *
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
#include "script_event.hpp"
|
||||
#include "script_goal.hpp"
|
||||
#include "script_window.hpp"
|
||||
#include "script_window.h"
|
||||
|
||||
/**
|
||||
* Event Vehicle Crash, indicating a vehicle of yours is crashed.
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
/** @file script_window.cpp Implementation of ScriptWindow. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "script_window.hpp"
|
||||
#include "script_window.h"
|
||||
#include "script_game.hpp"
|
||||
#include "../../window_func.h"
|
||||
#include "../../window_gui.h"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/** @file script_window.hpp Everything to handle window interaction. */
|
||||
/** @file script_window.h Everything to handle window interaction. */
|
||||
|
||||
#ifndef SCRIPT_WINDOW_HPP
|
||||
#define SCRIPT_WINDOW_HPP
|
Loading…
Reference in New Issue