Skip to content

Commit b6f4462

Browse files
committed
fix: experimental examples for macos
1 parent c3b6bcf commit b6f4462

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

examples/build_macos.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -941,8 +941,8 @@ PL_RESULT=${BOLD}${GREEN}Successful.${NC}
941941
PL_DEFINES="-D_USE_MATH_DEFINES -DPL_PROFILING_ON -DPL_ALLOW_HOT_RELOAD -DPL_ENABLE_VALIDATION_LAYERS -DPL_CONFIG_DEBUG -DPL_EXPERIMENTAL "
942942
PL_INCLUDE_DIRECTORIES="-I../examples -I../editor -I../src -I../libs -I../extensions -I../out -I../dependencies/stb -I../dependencies/imgui "
943943
PL_LINK_DIRECTORIES="-L../out -Wl,-rpath,../out -L/usr/local/lib -Wl,-rpath,/usr/local/lib "
944-
PL_COMPILER_FLAGS="-std=c++14 --debug -g -fmodules -ObjC -fPIC "
945-
PL_LINKER_FLAGS=""
944+
PL_COMPILER_FLAGS="-std=c++14 --debug -g -fmodules -ObjC++ -fPIC "
945+
PL_LINKER_FLAGS="-lstdc++ -ldl -lm "
946946
PL_STATIC_LINK_LIBRARIES="-ldearimguid "
947947
PL_DYNAMIC_LINK_LIBRARIES=""
948948
PL_SOURCES="example_basic_5.cpp "
@@ -1017,7 +1017,7 @@ PL_RESULT=${BOLD}${GREEN}Successful.${NC}
10171017
PL_DEFINES="-D_USE_MATH_DEFINES -DPL_PROFILING_ON -DPL_ALLOW_HOT_RELOAD -DPL_ENABLE_VALIDATION_LAYERS -DPL_CONFIG_DEBUG -DPL_EXPERIMENTAL "
10181018
PL_INCLUDE_DIRECTORIES="-I../examples -I../editor -I../src -I../libs -I../extensions -I../out -I../dependencies/stb -I../dependencies/imgui "
10191019
PL_LINK_DIRECTORIES="-L../out -Wl,-rpath,../out -L/usr/local/lib -Wl,-rpath,/usr/local/lib "
1020-
PL_COMPILER_FLAGS="-std=c++14 -fmodules -ObjC -fPIC "
1020+
PL_COMPILER_FLAGS="-std=c++14 -fmodules -ObjC++ -fPIC "
10211021
PL_LINKER_FLAGS=""
10221022
PL_STATIC_LINK_LIBRARIES="-ldearimgui "
10231023
PL_DYNAMIC_LINK_LIBRARIES=""

scripts/gen_examples.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@
147147
# macos
148148
with pl.platform("Darwin"):
149149
with pl.compiler("clang"):
150-
pl.add_compiler_flags("-std=c++14", "--debug", "-g", "-fmodules", "-ObjC", "-fPIC")
150+
pl.add_linker_flags("-lstdc++", "-ldl", "-lm")
151+
pl.add_compiler_flags("-std=c++14", "--debug", "-g", "-fmodules", "-ObjC++", "-fPIC")
151152
pl.add_link_frameworks("Metal", "MetalKit", "Cocoa", "IOKit", "CoreVideo", "QuartzCore")
152153
pl.add_link_directories("/usr/local/lib")
153154

@@ -173,7 +174,7 @@
173174
# macos
174175
with pl.platform("Darwin"):
175176
with pl.compiler("clang"):
176-
pl.add_compiler_flags("-std=c++14", "-fmodules", "-ObjC", "-fPIC")
177+
pl.add_compiler_flags("-std=c++14", "-fmodules", "-ObjC++", "-fPIC")
177178
pl.add_link_frameworks("Metal", "MetalKit", "Cocoa", "IOKit", "CoreVideo", "QuartzCore")
178179
pl.add_link_directories("/usr/local/lib")
179180

0 commit comments

Comments
 (0)