@@ -19,7 +19,7 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
19
19
endif ()
20
20
21
21
set (GLFM_SRC src/glfm_internal.h src/glfm_apple.m)
22
- set (GLFM_COMPILE_OPTIONS " -Wno-auto-import; -Wno-direct-ivar-access" )
22
+ set (GLFM_COMPILE_OPTIONS -Wno-auto-import -Wno-direct-ivar-access)
23
23
else ()
24
24
message (FATAL_ERROR "CMAKE_SYSTEM_NAME ('${CMAKE_SYSTEM_NAME} ') expected to be Darwin, Emscripten, or Android" )
25
25
endif ()
@@ -44,12 +44,17 @@ if (GLFM_USE_CLANG_TIDY)
44
44
message (WARNING "GLFM_USE_CLANG_TIDY=ON but clang-tidy not found" )
45
45
else ()
46
46
if (CMAKE_SYSTEM_NAME STREQUAL "Android" )
47
- set (CMAKE_C_CLANG_TIDY "${CLANG_TIDY_EXECUTABLE} ;--config-file=${PROJECT_SOURCE_DIR} /tests/clang-tidy-analyze.yml" )
47
+ set (CMAKE_C_CLANG_TIDY ${CLANG_TIDY_EXECUTABLE}
48
+ --config-file=${PROJECT_SOURCE_DIR} /tests/clang-tidy-analyze.yml)
48
49
elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin" )
49
50
message (WARNING "GLFM_USE_CLANG_TIDY=ON but clang-tidy not functional with Xcode generator" )
50
51
elseif (CMAKE_SYSTEM_NAME STREQUAL "Emscripten" )
51
52
set (CMAKE_C_USE_RESPONSE_FILE_FOR_INCLUDES 0)
52
- set (CMAKE_C_CLANG_TIDY "${CLANG_TIDY_EXECUTABLE} ;--config-file=${PROJECT_SOURCE_DIR} /tests/clang-tidy-analyze.yml;--extra-arg=--target=wasm32;--extra-arg=-D__EMSCRIPTEN__;--extra-arg=-isystem${EMSCRIPTEN_ROOT_PATH} /cache/sysroot/include" )
53
+ set (CMAKE_C_CLANG_TIDY ${CLANG_TIDY_EXECUTABLE}
54
+ --config-file=${PROJECT_SOURCE_DIR} /tests/clang-tidy-analyze.yml
55
+ --extra-arg=--target =wasm32
56
+ --extra-arg=-D__EMSCRIPTEN__
57
+ --extra-arg=-isystem${EMSCRIPTEN_ROOT_PATH} /cache /sysroot/include )
53
58
endif ()
54
59
endif ()
55
60
endif ()
@@ -63,12 +68,15 @@ source_group(src FILES ${GLFM_SRC})
63
68
64
69
set_target_properties (glfm PROPERTIES C_STANDARD 11)
65
70
if (CMAKE_C_COMPILER_ID MATCHES "Clang" )
66
- # Disable the -Wunsafe-buffer-usage warning because it reports false positives when bounds checking arrays, and there appears to be no solution for C pointers.
67
- set_target_properties (glfm PROPERTIES COMPILE_OPTIONS "-Weverything;-Wwrite-strings;-Wno-unknown-warning-option;-Wno-padded;-Wno-covered-switch-default;-Wno-declaration-after-statement;-Wno-unsafe-buffer-usage;${GLFM_COMPILE_OPTIONS} " )
71
+ # Disable the -Wunsafe-buffer-usage warning because it reports false positives when bounds checking arrays, and
72
+ # there appears to be no solution for C pointers.
73
+ set_property (TARGET glfm PROPERTY COMPILE_OPTIONS -Weverything -Wwrite-strings -Wno-unknown-warning-option
74
+ -Wno-padded -Wno-covered-switch-default -Wno-declaration-after-statement -Wno-unsafe-buffer-usage
75
+ ${GLFM_COMPILE_OPTIONS} )
68
76
elseif (CMAKE_C_COMPILER_ID MATCHES "GNU" )
69
- set_target_properties ( glfm PROPERTIES COMPILE_OPTIONS " -Wall; -Wextra; -Wwrite-strings; ${GLFM_COMPILE_OPTIONS} " )
77
+ set_property ( TARGET glfm PROPERTY COMPILE_OPTIONS -Wall -Wextra -Wwrite-strings ${GLFM_COMPILE_OPTIONS} )
70
78
elseif (CMAKE_C_COMPILER_ID MATCHES "MSVC" )
71
- set_target_properties ( glfm PROPERTIES COMPILE_OPTIONS " /Wall; ${GLFM_COMPILE_OPTIONS} " )
79
+ set_property ( TARGET glfm PROPERTY COMPILE_OPTIONS /Wall ${GLFM_COMPILE_OPTIONS} )
72
80
endif ()
73
81
74
82
if (CMAKE_SYSTEM_NAME STREQUAL "Android" )
0 commit comments