Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
glfw
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pirvi-public
glfw
Commits
cd70e1bb
Commit
cd70e1bb
authored
5 years ago
by
Camilla Löwy
Browse files
Options
Downloads
Patches
Plain Diff
Merge GCC/Clang specific CMake blocks
(cherry picked from commit
9dc365f1
)
parent
f318ab74
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/CMakeLists.txt
+17
-20
17 additions, 20 deletions
src/CMakeLists.txt
with
17 additions
and
20 deletions
src/CMakeLists.txt
+
17
−
20
View file @
cd70e1bb
...
...
@@ -79,20 +79,6 @@ if (APPLE)
LANGUAGE C
)
endif
()
# Make GCC and Clang warn about declarations that VS 2010 and 2012 won't accept
# for all source files that VS will build
if
(
"
${
CMAKE_C_COMPILER_ID
}
"
STREQUAL
"GNU"
OR
"
${
CMAKE_C_COMPILER_ID
}
"
STREQUAL
"Clang"
OR
"
${
CMAKE_C_COMPILER_ID
}
"
STREQUAL
"AppleClang"
)
set_source_files_properties
(
context.c init.c input.c monitor.c vulkan.c
window.c win32_init.c win32_joystick.c
win32_monitor.c win32_time.c win32_thread.c
win32_window.c wgl_context.c egl_context.c
osmesa_context.c PROPERTIES
COMPILE_FLAGS -Wdeclaration-after-statement
)
endif
()
add_library
(
glfw
${
glfw_SOURCES
}
${
glfw_HEADERS
}
)
set_target_properties
(
glfw PROPERTIES
OUTPUT_NAME
${
GLFW_LIB_NAME
}
...
...
@@ -123,6 +109,23 @@ target_include_directories(glfw PRIVATE
${
glfw_INCLUDE_DIRS
}
)
target_link_libraries
(
glfw PRIVATE
${
glfw_LIBRARIES
}
)
if
(
"
${
CMAKE_C_COMPILER_ID
}
"
STREQUAL
"GNU"
OR
"
${
CMAKE_C_COMPILER_ID
}
"
STREQUAL
"Clang"
OR
"
${
CMAKE_C_COMPILER_ID
}
"
STREQUAL
"AppleClang"
)
# Make GCC and Clang warn about declarations that VS 2010 and 2012 won't
# accept for all source files that VS will build
set_source_files_properties
(
context.c init.c input.c monitor.c vulkan.c
window.c win32_init.c win32_joystick.c
win32_monitor.c win32_time.c win32_thread.c
win32_window.c wgl_context.c egl_context.c
osmesa_context.c PROPERTIES
COMPILE_FLAGS -Wdeclaration-after-statement
)
# Enable a reasonable set of warnings (no, -Wextra is not reasonable)
target_compile_options
(
glfw PRIVATE
"-Wall"
)
endif
()
# HACK: When building on MinGW, WINVER and UNICODE need to be defined before
# the inclusion of stddef.h (by glfw3.h), which is itself included before
# win32_platform.h. We define them here until a saner solution can be found
...
...
@@ -130,12 +133,6 @@ target_link_libraries(glfw PRIVATE ${glfw_LIBRARIES})
target_compile_definitions
(
glfw PRIVATE
"$<$<BOOL:
${
MINGW
}
>:UNICODE;WINVER=0x0501>"
)
# Enable a reasonable set of warnings (no, -Wextra is not reasonable)
target_compile_options
(
glfw PRIVATE
"$<$<C_COMPILER_ID:AppleClang>:-Wall>"
"$<$<C_COMPILER_ID:Clang>:-Wall>"
"$<$<C_COMPILER_ID:GNU>:-Wall>"
)
if
(
BUILD_SHARED_LIBS
)
if
(
WIN32
)
if
(
MINGW
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment