Skip to content

Commit ea87681

Browse files
committed
CMake: Fix building scale2x by moving condition
1 parent c5cbd33 commit ea87681

File tree

3 files changed

+18
-20
lines changed

3 files changed

+18
-20
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ else()
148148
set(SDL_STATUS "SDL2")
149149
endif()
150150

151-
# bundled libraries
151+
# common bundled libraries
152152

153153
add_subdirectory(ext)
154154

@@ -186,6 +186,7 @@ if(SCALE)
186186
set(SCALE_STATUS "Enabled, scale2x")
187187
target_compile_definitions(OpenJazz PRIVATE SCALE)
188188
set(OJ_LIBS_SCALE scale2x)
189+
add_subdirectory(ext/scale2x)
189190
elseif(NOT LEGACY_SDL)
190191
# FIXME: add codepath for gpu scaling
191192
set(SCALE_STATUS "Disabled (currently broken in SDL2 port)")

ext/CMakeLists.txt

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,3 @@ add_library(psmplug STATIC
2828
psmplug/tables.h
2929
)
3030
target_include_directories(psmplug PUBLIC psmplug)
31-
32-
if(SCALE)
33-
# scale2x
34-
35-
include(Find-Restrict-Keyword)
36-
37-
add_library(scale2x STATIC
38-
scale2x/scale2x.cpp
39-
scale2x/scale2x.h
40-
scale2x/scale3x.cpp
41-
scale2x/scale3x.h
42-
scale2x/scalebit.cpp
43-
scale2x/scalebit.h
44-
)
45-
target_compile_definitions(scale2x PRIVATE
46-
USE_SCALE_RANDOMWRITE
47-
restrict=${RESTRICT_KEYWORD})
48-
target_include_directories(scale2x PUBLIC scale2x)
49-
endif()

ext/scale2x/CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# scale2x
2+
3+
include(Find-Restrict-Keyword)
4+
5+
add_library(scale2x STATIC
6+
scale2x.cpp
7+
scale2x.h
8+
scale3x.cpp
9+
scale3x.h
10+
scalebit.cpp
11+
scalebit.h
12+
)
13+
target_compile_definitions(scale2x PRIVATE
14+
USE_SCALE_RANDOMWRITE
15+
restrict=${RESTRICT_KEYWORD})
16+
target_include_directories(scale2x PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

0 commit comments

Comments
 (0)