Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
GDevelop/CMakeLists.txt at master · feifeivv/GDevelop · GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
See all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
feifeivv
GDevelop
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
GDevelop
/
CMakeLists.txt
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
100 lines (87 loc) · 3.6 KB
master
Breadcrumbs
GDevelop
/
CMakeLists.txt
Copy path
Top
File metadata and controls
Code
Blame
100 lines (87 loc) · 3.6 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#
This is the CMake file used to build GDevelop.
#
For more information, see the Readme.md file.
cmake_minimum_required
(
VERSION
2.6
)
cmake_policy
(
SET
CMP0011
NEW
)
#
Add utility functions
include
(
scripts/CMakeClangUtils.txt
)
#
To add clang-format and clang-tidy support to a target
#
Macro for defining an option
macro
(
gd_set_option
var
default
type
docstring
)
if
(
NOT
DEFINED
${var}
)
set
(
${var}
${default}
)
endif
()
set
(
${var}
${${var}
}
CACHE
${type}
${docstring}
FORCE
)
endmacro
()
gd_set_option
(
BUILD_CORE
TRUE
BOOL
"TRUE to build GDevelop Core library"
)
gd_set_option
(
BUILD_GDJS
TRUE
BOOL
"TRUE to build GDevelop JS Platform"
)
gd_set_option
(
BUILD_EXTENSIONS
TRUE
BOOL
"TRUE to build the extensions"
)
gd_set_option
(
BUILD_TESTS
FALSE
BOOL
"TRUE to build the tests"
)
#
Disable deprecated code
set
(NO_GUI
TRUE
CACHE
BOOL
""
FORCE
)
#
Force disable old GUI related code.
#
Setting up installation directory, for Linux (has to be done before "project" command).
IF
(
NOT
WIN32
)
if
(
NOT
APPLE
)
gd_set_option
(
GD_INSTALL_PREFIX
"/opt/gdevelop/"
STRING
"The directory where GDevelop should be installed"
)
ELSE
()
gd_set_option
(
GD_INSTALL_PREFIX
"."
STRING
"The directory where GDevelop should be installed"
)
ENDIF
()
#
As we embed SFML, prevent it to be installed system-wide
set
(
CMAKE_INSTALL_PREFIX
"
${GD_INSTALL_PREFIX}
/useless"
)
ENDIF
()
project
(GDevelop)
set
(
CMAKE_EXPORT_COMPILE_COMMANDS
ON
)
IF
(
NOT
WIN32
AND
NOT
APPLE
AND
NOT
BUILD_TESTS)
SET
(
CMAKE_SKIP_BUILD_RPATH
TRUE
)
#
Avoid errors when packaging for linux.
ENDIF
()
IF
(
APPLE
)
set
(CMAKE_MACOSX_RPATH 1)
set
(
CMAKE_INSTALL_RPATH_USE_LINK_PATH
FALSE
)
set
(
CMAKE_INSTALL_RPATH
"."
)
set
(
CMAKE_BUILD_WITH_INSTALL_RPATH
TRUE
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-D_WCHAR_H_CPLUSPLUS_98_CONFORMANCE_"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-potentially-evaluated-expression"
)
ENDIF
()
#
Sanity checks
IF
(
"
${
CMAKE_BUILD_TYPE
}
"
STREQUAL
""
)
message
(
"CMAKE_BUILD_TYPE is empty, assuming build type is Release"
)
set
(
CMAKE_BUILD_TYPE
Release)
ENDIF
()
IF
(
"
${
CMAKE_BUILD_TYPE
}
"
STREQUAL
"Release"
AND
NOT
WIN32
AND
CMAKE_COMPILER_IS_GNUCXX)
SET
(
CMAKE_SHARED_LINKER_FLAGS
"-s"
)
#
Force stripping to avoid errors when packaging for linux.
ENDIF
()
#
Activate C++11
include
(
CheckCXXCompilerFlag
)
CHECK_CXX_COMPILER_FLAG
(
"-std=gnu++11"
COMPILER_SUPPORTS_CXX11
)
CHECK_CXX_COMPILER_FLAG
(
"-std=gnu++0x"
COMPILER_SUPPORTS_CXX0X
)
if
(COMPILER_SUPPORTS_CXX11)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-std=gnu++11"
)
elseif
(COMPILER_SUPPORTS_CXX0X)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-std=gnu++0x"
)
else
()
message
(
FATAL_ERROR
"The compiler
${
CMAKE_CXX_COMPILER
}
has no C++11 support (with GNU extensions). Please use a different C++ compiler."
)
endif
()
#
Mark some warnings as errors
if
(
CMAKE_CXX_COMPILER_ID
STREQUAL
"Clang"
)
#
Activate as much warnings as possible to avoid errors like
#
uninitialized variables or other hard to debug bugs.
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wall"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-unknown-warning-option"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-reorder-ctor -Wno-reorder -Wno-pessimizing-move -Wno-unused-variable -Wno-unused-private-field"
)
#
Make as much warnings considered as errors as possible (only one for now).
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Werror=return-stack-address"
)
endif
()
#
Define common directories:
set
(GD_base_dir
${
CMAKE_CURRENT_SOURCE_DIR
}
)
#
Add all the CMakeLists:
ADD_SUBDIRECTORY
(
ExtLibs
)
IF
(BUILD_CORE)
ADD_SUBDIRECTORY
(
Core
)
ENDIF
()
IF
(BUILD_GDJS)
ADD_SUBDIRECTORY
(
GDJS
)
ENDIF
()
IF
(EMSCRIPTEN)
ADD_SUBDIRECTORY
(
GDevelop.js
)
ENDIF
()
IF
(BUILD_EXTENSIONS)
ADD_SUBDIRECTORY
(
Extensions
)
ENDIF
()
You can’t perform that action at this time.