Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
miniaudio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
miniaudio
Commits
d3a4b9cf
Commit
d3a4b9cf
authored
Feb 19, 2025
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor changes to CMakeLists.
parent
48ac10d1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
CMakeLists.txt
CMakeLists.txt
+16
-7
No files found.
CMakeLists.txt
View file @
d3a4b9cf
...
...
@@ -7,8 +7,8 @@ project(miniaudio
# Options
option
(
MINIAUDIO_BUILD_EXAMPLES
"Build miniaudio examples"
OFF
)
option
(
MINIAUDIO_BUILD_TESTS
"Build miniaudio tests"
OFF
)
option
(
MINIAUDIO_FORCE_CXX
"
Use C++ compiler for C files"
OFF
)
option
(
MINIAUDIO_FORCE_C89
"
Use C89 standard"
OFF
)
option
(
MINIAUDIO_FORCE_CXX
"
Force compilation as C++"
OFF
)
option
(
MINIAUDIO_FORCE_C89
"
Force compilation as C89"
OFF
)
option
(
MINIAUDIO_NO_LIBVORBIS
"Disable miniaudio_libvorbis"
OFF
)
option
(
MINIAUDIO_NO_LIBOPUS
"Disable miniaudio_libopus"
OFF
)
option
(
MINIAUDIO_NO_WASAPI
"Disable the WASAPI backend"
OFF
)
...
...
@@ -64,19 +64,30 @@ option(MINIAUDIO_DEBUG_OUTPUT "Enable stdout debug output"
# Construct compiler options.
set
(
COMPILE_OPTIONS
)
if
(
MINIAUDIO_FORCE_CXX AND MINIAUDIO_FORCE_C89
)
message
(
FATAL_ERROR
"MINIAUDIO_FORCE_CXX and MINIAUDIO_FORCE_C89 cannot be enabled at the same time."
)
endif
()
if
(
MINIAUDIO_FORCE_CXX
)
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"GNU"
OR CMAKE_CXX_COMPILER_ID STREQUAL
"Clang"
)
message
(
STATUS
"Compiling as C++ (GNU/Clang)"
)
list
(
APPEND COMPILE_OPTIONS -x c++
)
elseif
(
CMAKE_CXX_COMPILER_ID STREQUAL
"MSVC"
)
message
(
STATUS
"Compiling as C++ (MSVC)"
)
list
(
APPEND COMPILE_OPTIONS /TP
)
else
()
message
(
WARNING
"MINIAUDIO_FORCE_CXX is enabled but the compiler does not support it. Ignoring."
)
endif
()
endif
()
if
(
MINIAUDIO_FORCE_C89
)
if
(
CMAKE_C_COMPILER_ID STREQUAL
"GNU"
OR CMAKE_C_COMPILER_ID STREQUAL
"Clang"
)
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"GNU"
OR CMAKE_CXX_COMPILER_ID STREQUAL
"Clang"
)
message
(
STATUS
"Compiling as C89"
)
list
(
APPEND COMPILE_OPTIONS -std=c89
)
elseif
(
CMAKE_C_COMPILER_ID STREQUAL
"MSVC"
)
# MSVC does not have an option for forcing C89.
elseif
(
CMAKE_CXX_COMPILER_ID STREQUAL
"MSVC"
)
message
(
WARNING
"MSVC does not support forcing C89. MINIAUDIO_FORCE_C89 ignored."
)
else
()
message
(
WARNING
"MINIAUDIO_FORCE_C89 is enabled but the compiler does not support it. Ingoring."
)
endif
()
endif
()
...
...
@@ -245,8 +256,6 @@ if(NOT MINIAUDIO_NO_LIBVORBIS)
else
()
message
(
STATUS
"libvorbisfile not found. miniaudio_libvorbis will be excluded."
)
endif
()
endif
()
if
(
NOT MINIAUDIO_NO_LIBOPUS
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment